Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Pattern Finder

by japhy (Canon)
on Sep 11, 2001 at 05:34 UTC ( [id://111644]=CUFP: print w/replies, xml ) Need Help??

From Pattern Finding. Update: silly me. It works now.
sub find_pat { use re 'eval'; my $n = shift; my $re = qq{ (?{ local (@{[ map "\$c$_,", 1 .. $n ]}) = (0) x $n }) ^ }; $re .= qq{ (.+?) (?: @{[ join " |\n", map " \\$_ (?{ local \$c$_ = \$c$_ + 1 })", 1 .. $_ +]} )* } for 1 .. $n; $re .= qq{ (?(?{ @{[ join ' && ', map "\$c$_", 1 .. $n ]} })|(?!)) \$ }; return qr/$re/x; }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2024-04-19 17:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found