in reply to Substituting with match containing newline and space characters
Using a single regex to substitute the match seems to work:
$my_file =~ s/(input type=\"checkbox\".*?(\w+)\[0\]")/$1 label="$2"/gs;The only modification I made to your original expression is adding " at the end of the outermost capture group.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Substituting with match containing newline and space characters
by MorayJ (Beadle) on Mar 30, 2015 at 13:46 UTC | |
by jeffa (Bishop) on Mar 30, 2015 at 18:11 UTC | |
by MorayJ (Beadle) on Mar 31, 2015 at 11:27 UTC |