Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

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

by LanX (Saint)
on Oct 08, 2009 at 21:39 UTC ( [id://800103]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://800103]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (2)
As of 2024-04-26 01:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found