in reply to Re: Regex to strip, keep, or add—depending
in thread Regex to strip, keep, or add—depending

FYI... The example I gave will not have issues with nested parens. * (being greedy) would match the last paren followed by a semi-colon (thus nested parens would not be an issue (unless there were nested parens with in the nested function call)).

Further proving my point that the perl parser will handle more than you would ever want to try with a regex.

Update: I am wrong. The regex I posted will actually match the first ) followed by a ;... which will break in a nested function call. However nested parens aside... my original point, that you (porbably) do not want to attempt to account for everything the perl parser will account for, remains valid.


They say that time changes things, but you actually have to change them yourself.

—Andy Warhol

Replies are listed 'Best First'.
Re^3: Regex to strip, keep, or add—depending
by chester (Hermit) on Aug 06, 2005 at 17:27 UTC
    I'm in full agreement, it's unlikely that any regex will work in all cases. Mine certainly doesn't. Catching nested parens would be as far as I'd want to take it; if I was doing this for my own purposes, probably not even that far. But I wanted to try it for educational purposes (educating myself, that is).
      PPI