Sometimes I have to use reg expres. for quite an amount of data, how bad could it affect the speed/runtime of the script?
| SitePoint Sponsor |





Sometimes I have to use reg expres. for quite an amount of data, how bad could it affect the speed/runtime of the script?
- Son Nguyen
AdSpeed.com - Ad Serving and Ad Management Made Easy
It's slow but not horribly slow. I read somewhere that it is faster than substr. It also depends if you use greedy or non-greedy regular expressions. Non-greedy look for the smallest possible result while greedy look for the largest possible result. Greedy are normal and I believe slightly faster. There are entire books on how to optime regular expressions if you really want to maximize speed. (I recomend Master Regular Expressions, O'Reilly.)
Owen
Bookmarks