Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Apply A Set Of Regexes To A String

by Cody Pendant (Prior)
on Oct 11, 2004 at 01:58 UTC ( [id://398070]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
            $html =~ s/foo/bar/;
            $html =~ s/baz/quux/;
            $html =~ s/monkey/pants/;
    
  2. or download this
            $html =~ s/foo/bar/;
            
    ...
            }
            
            $html =~ s/monkey/pants/;
    
  3. or download this
            $replacements =
                [
                    ['foo','bar'],
                    ['baz','quux']
                ];
    
  4. or download this
            $replacements =
                {  
                    fix_foo => ['foo','bar'],
                    fix_baz => ['baz','quux']
                };
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://398070]
Approved by BrowserUk
Front-paged by grinder
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2024-04-18 02:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found