I posted this as a tip to the readers of this thread. The audience is people who aren't too fluent with regexes, and the regex for matching the question is perhaps tough for beginners. I merely wanted to point out that you don't always have to use that cumbersome and easy-to-slip-with solution. And yes, I understand that it was for educational purposes.
The task was to get rid of .*?'s in this case unwanted behaviour. That is what my solution does. I don't see why this solution doesn't fit into the thread as nicely as Ovid's regex.
I was a bit sparse with words in my previous post, but I had no intention to devalue Ovid's node. I think it's great. I just wanted to share an idea that was applyable to the problem Ovid was solving.
-Anomo | [reply] [Watch: Dir/Any] [d/l] |
The following article is about using reverse regular expressions, or sexgers (snicker). Its purpose it to increase efficency by avoiding the lookahead mechanism.
http://www.perl.com/pub/a/2001/05/01/expressions.html
Todd W. | [reply] [Watch: Dir/Any] |