in reply to Re: Re: Re: Simple Regex Question
in thread Simple Regex Question

This is a good article explaining what happens inside the RE engine. Take what you have vs other answers and see what the RE engine would do with them. Also add the fact that the other answers looked for a match, and didn't do a substitution (which isn't needed in this case).

And is this inefficiency lost in the noise of overall execution times

No.. it could make the execution time longer. If you ran that match against 10_000 lines, it would produce it's own noise.. compared to the other solutions.

I'm not trying to come down on ya :) Read that article, read perlre, and Mastering Regular Expressions. Then, practice working with REs. I bet in a few weeks you would look at this and say "I am now so much wiser!" :)

Cheers,
KM

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Simple Regex Question
by sierrathedog04 (Hermit) on Jan 30, 2001 at 07:35 UTC
    Fair enough. I will try and avoid posting my own regex solutions on this site until I have read Mastering Regular Expressions and the article you recommended.