Vlastimil Brom <vlastimil.b...@gmail.com> added the comment:

Maybe I am missing something, but the result in regex seem ok to me:
\A is treated like A in a character set; when the test string is changed to "A 
b c" or in the case insensitive search the A is matched.

[\A\s]\w doesn't match the starting "a", as it is not followed by any word 
character:

>>> for s in [r'\A\w', r'[\A]\w', r'[\A\s]\w']: print regex.findall(s, 'A b c')
... 
['A']
[]
[' b', ' c']
>>> for s in [r'\A\w', r'(?i)[\A]\w', r'[\A\s]\w']: print regex.findall(s, 'a b 
>>> c')
... 
['a']
[]
[' b', ' c']
>>> 

In the original re there seem to be a bug/limitation in this regard (\A and 
also \Z in character sets aren't supported in some combinations...

vbr

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue2636>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to