Zdenek Sekera wrote:
Sorry, I should have been clearer:
Note the placement of the '+' in my pattern, somewhere
in the middle, there it doesn't cause any problem:
if (char =~ '\m[;|<>?:[EMAIL PROTECTED]&*(){}\\_+-[\]/\"]'
^
| here
The erroneous (in my judgement) patterns are (e.g.) are these:
if (char =~ '\m[;|<>?:[EMAIL PROTECTED]&*(){}\\_-[\]/\"+]')
if (char =~ '\m[;|<>?:[EMAIL PROTECTED]&*(){}\\_-[\]/\"\+]')
So the question is why is it OK to have '+' in the middle
and not at the end?
It has nothing to do with +, and everything to do with - . The "-" is a
range character,
more commonly seen with something like [a-z] (which stands for all lower
case characters).
You need to escape the minus sign (ie. \-).
Regards,
Chip Campbell