Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

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

by johngg (Canon)
on Jun 23, 2006 at 14:22 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (3)
As of 2024-04-25 02:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found