Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^3: Pattern Identification

by AnomalousMonk (Archbishop)
on Oct 01, 2017 at 15:27 UTC ( [id://1200471]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Pattern Identification
in thread Pattern Identification

... key points ... "map" [which] appears to create a hash ...

No "hash" (in the sense of an associative array) is created at any point. The critical effect of the map expression is to extract the format regex ($1) and descriptive text ($2) substrings from each data type specifier record and use them to build a sub-regex for each data type. The  (?{'$2'}) sub-sub-regex generates code that evaluates the descriptive text substring and returns it via the  $^R regex special variable (see perlvar). All these sub-regexes are then concatenated together into one big alternation.

You can just
    print $regex, "\n";
and pick your way through the result to see the alternation of all the sub-regexes in all their glory.


Give a man a fish:  <%-{-{-{-<

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2026-03-17 03:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.