I think the problem you’re seeing is probably caused by failure to match \b. From “Assertions” in perlre#Regular-Expressions:
A word boundary (\b) is a spot between two characters that has a \w on one side of it and a \W on the other side of it (in either order), counting the imaginary characters off the beginning and end of the string as matching a \W.
So, if there is there is no underscore character, the expression (?:\b|_) attempts to match \b, but this fails if $parse1 begins with a forward slash since that character is not a “word” character — unless the preceding character happens to be a “word” character, which is unlikely in this scenario.
Hope that helps,
Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
In reply to Re: regex question
by Athanasius
in thread regex question
by Anonymous Monk
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |