Well, maybe not in this case, but this ([^\-]|$) will consume a position.
This can become an issue if you start combining with following matches.
That's why I recommended a "lookahead assertion" which is zero width.
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
FootballPerl is like chess, only without the dice
In reply to Re^2: Regex boundary match
by LanX
in thread Regex boundary match
by ultranerds
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |