On Wednesday, July 23, 2003, at 03:35 PM, Alex Rice wrote:

You get "apple xxxxx" because the regex I wrote is greedy. You could modify the regex so it's not greedy. (I think "greedy" is the term they use, but not sure)

"![^!/]+/!"

AHA! That works. So... I guess replaceText() replaces all matches by default, which is why it doesn't understand the "(?g)" global substitution modifier- it doesn't need to!

Everyone should learn Perl regular expressions :-) It's well worth the trouble!

Alex Rice

Alex,

This regEx stuff is very cool. Now I have a new area of optimizations for my pull-parser experiments.

Thanks,

Mark

Reply via email to