Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^7: regex return true instead of false (precedence)

by rsFalse (Chaplain)
on Aug 27, 2019 at 23:08 UTC ( [id://11105147]=note: print w/replies, xml ) Need Help??


in reply to Re^6: regex return true instead of false (precedence)
in thread regex return true instead of false

"I don't understand the purpose of the (*FAIL) operator" -- AnomalousMonk.

It has the same purpose as zero in separated regex example. It allows '||' or '|' be written before first conditional. And then all conditionals have the same line-format. For me it is more readable :)

It is similar to:
if( 0 ){ ; } elsif( condition_1 ){ ... } elsif( condition_2 ){ ... } elsif( condition_3 ){ ... }
...which is sometimes a bit more readable. Also then I can easily change the sequence of conditions by only swapping lines (including the line with the first condition).

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (None)
    As of 2024-04-25 01:51 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found