in reply to Regexp: not what I'd expected
Knowing that, I think your results will now make perfect sense to you. Since $bef[$mid] is not defined, $bef[$mid]$aft becomes a string containing undef followed by 'after.' $bef$mid[$aft] becomes 'before' followed undef.
Escape the square brackets with a backslash, and all will be well.
I think this was mainly just an oversight. One of those things that, until it's pointed out to you, you can't see it at all, but once you see it, it's obvious. :-)
Russ
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: RE: Regexp: not what I'd expected
by greenhorn (Sexton) on Jul 04, 2000 at 06:13 UTC |