Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^2: Compiling Regular Expressions

by johndeighan (Novice)
on Mar 11, 2016 at 16:05 UTC ( [id://1157455]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $kind;
    my $REGEX  = qr/
    ...
            | \x27 ( (?:[^\x27] | \x27{2})* ) \x27 (?{$kind = 'STRING';})
            | \S                                   (?{$kind = 'OTHER';})
            /xs;
    
  2. or download this
    my $IDENT  = qr/ [A-Za-z][\w]*                        /xs;
    my $STRING = qr/ \x27 ( (?:[^\x27] | \x27{2})* ) \x27 /xs;
    ...
            | $STRING   (?{$kind = 'STRING';})
            | \S        (?{$kind = 'OTHER';})
            /xs;
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (5)
As of 2024-03-28 13:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found