tag:blogger.com,1999:blog-18724657.post2748566444286867555..comments2024-01-04T16:54:58.646-08:00Comments on Andrei's blog: CAtlRegExp Match access violationAndrei Nitescuhttp://www.blogger.com/profile/17106850549627677414noreply@blogger.comBlogger1125tag:blogger.com,1999:blog-18724657.post-73822314042064179132007-02-18T02:56:00.000-08:002007-02-18T02:56:00.000-08:00You can greatly improve the class performance if y...You can greatly improve the class performance if you cache the object.<BR/> For example, if you know you will be Match-ing several times the same regular expression, in order to improve performance, you need to keep the CAtlRegExp object seperately, Parse() once and Match() every time you need.<BR/><BR/><BR/> CAtlRegExp<> rx;<BR/> <BR/> void InitOnce()<BR/> {<BR/> rx.Parse(..);<BR/> }<BR/><BR/> void Do1()<BR/> {<BR/> rx.Match()<BR/> } <BR/><BR/> void Do2()<BR/> {<BR/> rx.Match()<BR/> } <BR/><BR/> main()<BR/> { <BR/> InitOnce();<BR/> Do1();<BR/> Do2();<BR/><BR/> ...<BR/> }Anonymousnoreply@blogger.com