Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^2: Compiling Regular Expressions

by johndeighan (Novice)
on Mar 11, 2016 at 11:05 UTC ( #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 taking refuge in the Monastery: (5)
As of 2023-12-02 18:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (18 votes). Check out past polls.

    Notices?