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

Re^2: Regex to replace a particular part of content

by johngg (Canon)
on Jun 23, 2006 at 14:22 UTC ( #557197=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
    $message =~ s{$rxToChange}{<item>$^N</item>}g;
    
    print $message;
    
  2. or download this
    The quick brown fox jumps over the lazy dog. The quick brown fox jumps
    + over the lazy dog. The quick brown fox jumps over the lazy dog. The 
    +quick brown fox jumps over the lazy dog. The quick brown fox jumps ov
    +er the lazy dog. The quick brown fox jumps over the lazy dog. The qui
    +ck brown fox jumps over the lazy dog. 
    <list>The quick brown fox jumps over the lazy dog. 
    ...
    <item>The quick brown fox jumps over the lazy dog. </item>
    <item>The quick brown fox jumps over the lazy dog. </item></list>
    The quick brown fox jumps over the lazy dog. The quick brown fox jumps
    + over the lazy dog. The quick brown fox jumps over the lazy dog. The 
    +quick brown fox jumps over the lazy dog. The quick brown fox jumps ov
    +er the lazy dog. The quick brown fox jumps over the lazy dog.
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2022-08-13 09:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?