Post Reply 
Addings/modifications to help files
Jul. 20, 2009, 03:44 PM (This post was last modified: Jul. 21, 2009 01:40 AM by whenever.)
Post: #20
RE: Addings/modifications to help files
(Jul. 20, 2009 08:18 AM)sidki3003 Wrote:  Significantly faster. Which is the point of entire chapter 10. Test it. Wink

A test proved I was wrong. Sad

"*>" is much faster than "[^>]+>", even "?++>" is faster than "[^>]+>". This is totally different from what I know about common regex flavors' behaving on Greedy vs. Lazy. It seems "*" in prox is not simply the ".*?" in common regex flavors and Scott had made special optimization for it.

"Look around" in common regex flavors doesn't consume characters, I think you are not meaning that when you say "look ahead" in your docs, so my suggestion is as below:

Quote:10a "+" -- Suppressing expression match attempts
You can use "+" loops to suppress match attempts *within* the preceding subexpression.

... wouldn't work, because "*>" doesn't stop at the first match and is matching forward

... does what we want, quickly. "*>", "*<" are not trying new match attempts anymore.

prefix(-possible_suffix|)\1*some_string
... would cause the filter attempting twice ("-possible_suffix" AND empty) before it fails to match:
"prefix-possible_suffix ... no_match"
Add Thank You Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Addings/modifications to help files - whenever - Jul. 20, 2009 03:44 PM

Forum Jump: