in reply to Re: Inserting numbers between parenthese matches in regexp
in thread Inserting numbers between parenthese matches in regexp
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: x2 Inserting numbers between parenthese matches in regexp
by BrowserUk (Patriarch) on Jun 27, 2004 at 22:03 UTC |