in reply to Re: Re: Regular Expression To Extract Multiple Matches Pattern
in thread Regular Expression To Extract Multiple Matches Pattern

Further on down in the post, Cody says ...

...but surely there's a smarter way to do it than check there's a match, then extract it with one regex, then remove it from the test string with another?

Perhaps I'm reading the bolded part of that wrong, but it sounds like replacing to me; a notion reinforced by the code snippet given.

The $1 was an oversight, though: an artifact of using -l in my shebang. ;)

    --k.


  • Comment on Re: Re: Re: Regular Expression To Extract Multiple Matches Pattern

Replies are listed 'Best First'.
Re: Re: Re: Re: Regular Expression To Extract Multiple Matches Pattern
by Cody Pendant (Prior) on Jan 08, 2002 at 01:02 UTC
    Hi, thank you all for your help.

    The regex I put in there is not exactly the regex I used, as I said, the regex was not the point of the exercise.

    It all seems so simple now that I know I can do a "while" like that.