in reply to Re: Removing only the first instance with RegEx
in thread Removing only the first instance with RegEx

For the most part I understand what it's doing, but could you explain the '*' in the RegEx?

Thanks

  • Comment on Re: Re: Removing only the first instance with RegEx

Replies are listed 'Best First'.
Re: Removing only the first instance with RegEx
by Abigail-II (Bishop) on Nov 06, 2003 at 14:29 UTC
    For the most part I understand what it's doing, but could you explain the '*' in the RegEx?

    Fascinating. You understand compiled regular expressions, delayed regular expressions, $&, but not '*', one of the most used special tokens in a regular expression?

    Anyway, as 'man perlre' could have told you, '*' means that the thing in front of it can be matched zero or more times.

    Abigail

      Wow...it's too early in the AM. I did know what'*' (zero or more) and '+' (one or more) mean.

      sorry!