$_ =~ s/<csp c="(\d+)">/"<colspec colnum=\"1\" colname=\"col1\"\/>" +x $1/egs;
Note that qq// can be substituted for "" for the same effect. That way there will no need to escape a ". Similarly, / delimiter can be substituted with other character(s) which do(es) not appear in your pattern or replacement to avoid escaping of the delimiter character ...
$_ =~ s[<csp c="(\d+)">][qq(<colspec colnum="1" colname="col1"/>) x $1 +]egsx;
In reply to Re: Making multiple replaces through Regex
by parv
in thread Making multiple replaces through Regex
by rsriram
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |