in reply to Re: A (non) reg-ex question
in thread A (non) reg-ex question
I am trying to understand your third method that uses the recursive regular expression. What I think it is doing is finding balanced "01" pairs in the same way as the Camel book example finds balanced "()" pairs. What I want to know is, how does the regular expression know when to stop recursing? Is the "?" quantifier something to do with it? It seems to me that the regular expression is consuming characters from both ends of the string at the same time. Am I missing something obvious?
Cheers,
JohnGG
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: A (non) reg-ex question
by hv (Prior) on Mar 20, 2006 at 23:51 UTC | |
by johngg (Canon) on Mar 21, 2006 at 00:11 UTC |