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.
In reply to Re: Substituting with match containing newline and space characters
by kroach
in thread Substituting with match containing newline and space characters
by MorayJ
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |