Often better to do such things in a single pass.
s{[\\@]([\\@]|[_A-Za-z]+)}{ my $term = $1; if( $term =~ /[\\@]/ ) { $term # Replace repeated escapes with second of pair } else { print "Extracted code '$term'\n"; '' # Replace extracted codes with nothing. } }ge;
- tye
In reply to Re: better way to escape escapes (1 pass)
by tye
in thread better way to escape escapes
by RonW
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |