
PGScooter
stranger
Mar 24, 2008, 8:59 PM
Post #3 of 5
(2075 views)
|
thanks Kevin, I guess I thought that non-greedy regexes matched as LITTLE as possible but obviously that is not the case. Now I understand the difference between greedy and non-greedy better; your example helped. Is it ever good coding to reverse a string, regex it, and reverse it back? or is that poor perl-edicate? Is there always a more elegant, straight-up regex? In this example, it would be easy to reverse the string, and just do a search matching up to the first forward slash, then reverse the match back. The more you teach me, the more I learn. The more I learn, the more I teach.
|