in reply to Supplying the RHS to a regex as a variable
$s = ' <p>something something</p> <h2>blah blah blah</h2> <p>something something</p> '; $before = '<h2>([^<]+)</h2>'; $after = '"<h1>$1</h1>"'; $s =~ s/$before/$after/ee; print $s;
<p>something something</p> <h1>blah blah blah</h1> <p>something something</p> Tool completed successfully
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Supplying the RHS to a regex as a variable
by Cody Pendant (Prior) on Oct 18, 2003 at 07:19 UTC | |
|
Re: Re: Supplying the RHS to a regex as a variable
by pg (Canon) on Oct 18, 2003 at 06:19 UTC | |
by BUU (Prior) on Oct 18, 2003 at 07:21 UTC |