Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Tidying and simplifying a regular expression

by tinita (Parson)
on Dec 08, 2017 at 19:05 UTC ( #1205199=note: print w/replies, xml ) Need Help??


in reply to Tidying and simplifying a regular expression

Because I recently learned about regexp_pattern (see thread), this might work, but it might not handle every case (there are other flags besides "u"):
use re (); for (1..10) { my ($pat, $flags) = re::regexp_pattern($rex); $rex = ($flags eq "u" or $flags eq "") ? qr{$pat.} : qr{$rex.}; }

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2019-10-15 07:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?