Replace
m/[a-g]+\n/
with
m/^[a-g]+\n$/
It was matching the "g\n" part of the input string.
By the way, it's <code> (or <c>), not [code].
In reply to Re: Is thie a regex strangeness?
by ikegami
in thread Is this a regex strangeness?
by mr_mischief
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |