[issue10539] Regular expression not checking 'range' element on 1st char in string.

Eric Smith report at bugs.python.org
Fri Nov 26 19:37:03 CET 2010


Eric Smith <eric at trueblade.com> added the comment:

I'm not sure I understand. The output I get is:

f42e6be1-29bf-4f3c-ba58-1ae1d9ca5f88
g42e6be1-29bf-4f3c-ba58-1ae1d9ca5f88
False

The first string matches. The second string matches because the leading "g" is being matched by "\w". The third string does not match because the "g" in the second position is not matched by "[0-9][a-f]".

For the second string you're matching "\w" followed by 7 "[0-9][a-f]", just as the regex allows.

Am I missing something?

----------
nosy: +eric.smith

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue10539>
_______________________________________


More information about the Python-bugs-list mailing list