in reply to Re^2: RegEx - match pattern not followed by literal
in thread RegEx - match pattern not followed by literal

Well, it wasn't really a question about optimisation (in terms of speed) - more about 'neatness'.

Neatness is in the eye of the beholder. General rule is: if it fits naturally in two separate matches then chances are that indeed it may be done in one, but at the expense of neatness, and vice versa. I say so because it happens all the time to read about people who "want to do it in just one match" since they think it's neater. Most times it plainly won't be.

  • Comment on Re^3: RegEx - match pattern not followed by literal