Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Smart match & substitution

by ikegami (Patriarch)
on Feb 09, 2015 at 18:05 UTC ( [id://1116078]=note: print w/replies, xml ) Need Help??


in reply to Smart match & substitution

it is apparently "almost" trivial to smart match against a vast swathe of regex patterns by smart matching an array.

my $regexp = join '|', @patterns; $str =~ /$regexp/

That's cool. But what if I want to sub out as a result ?

$cleanLine =~ s/$_//g for @regexps;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (2)
As of 2024-04-25 20:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found