$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
In reply to Re: Supplying the RHS to a regex as a variable
by BUU
in thread Supplying the RHS to a regex as a variable
by Cody Pendant
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |