in reply to Re^5: Regex for matching n-fold repititions of arbitrary characters
in thread Regex for matching n-fold repititions of arbitrary characters

Note that if "aabbaab" =~ /aa|bb/g is wrong. Red flags should be raised when you see /g in scalar context outside a loop.

Not necessarily! It makes sense when parsing with nested ifs! Friedl's book has some nifty examples...

Cheers Rolf

  • Comment on Re^6: Regex for matching n-fold repititions of arbitrary characters

Replies are listed 'Best First'.
Re^7: Regex for matching n-fold repititions of arbitrary characters
by ikegami (Patriarch) on Oct 09, 2009 at 02:19 UTC

    I didn't say m//g in scalar context outside a loop is wrong. I said it's usually wrong. I said the code he used was wrong.

    And I bet his tokenizers used /c too