I'm curious. Question of style, why the square braces as delimiters? There are no slashes in what is matched, so there's no problem regarding leaning toothpicks.
I had to think for an extra second or two to figure out what you were doing, which in fact is quite clever. Bear with me, I want to see what this looks like:
s/(?<=[a-m])(?=[n-z])/5/g;
I dunno, somehow that seems clearer to me. I think it is because otherwise I find my eyes skipping back and forward too much between the character classes and the s-op delimiters. (But ++ all the same, I'll keep this technique in mind).
- another intruder with the mooring of the heat of the Perl
In reply to Re:x2 Inserting numbers between parenthese matches in regexp
by grinder
in thread Inserting numbers between parenthese matches in regexp
by Melroch
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |