in reply to Re: Simple Regular Expression Help Needed
in thread Simple Regular Expression Help Needed

Just as a side note here - that ? to make the match non-greedy. You have anchors at both ends (^ $), so greediness shouldn't come into play here. You actually do want to match as much as possible.

Yeah, I know. Really minor. :-)

  • Comment on Re^2: Simple Regular Expression Help Needed

Replies are listed 'Best First'.
Re^3: Simple Regular Expression Help Needed
by northwind (Hermit) on May 25, 2005 at 17:37 UTC

    Yep, you're right.  For whatever reason, I had non-backtracking patterns on the brain even though there is nothing in the regex that states it is non-backtracking...  And the $ shouldn't be there, it was a blind copy/paste from OP's code.