py.user <port...@yandex.ru> added the comment:

Martin v. Löwis wrote:
> What behavior would you expect?

I expected similar work

>>> re.search(r'[\s]a', ' a').group()
' a'
>>> re.search(r'[\s]a', 'ba').group()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'NoneType' object has no attribute 'group'
>>> 
>>> 
>>> re.search(r'[^\s]a', ' a').group()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'NoneType' object has no attribute 'group'
>>> re.search(r'[^\s]a', 'ba').group()
'ba'
>>>

----------

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

Reply via email to