Matthew Barnett <pyt...@mrabarnett.plus.com> added the comment:

issue2636-features-5.diff includes:

Bugfixes
Added \G anchor (from Perl).

\G is the anchor at the start of a search, so re.search(r'\G(\w)') is
the same as re.match(r'(\w)').

re.findall normally performs a series of searches, each starting where
the previous one finished, but if the pattern starts with \G then it's
like a series of matches:

>>> re.findall(r'\w', 'abc def')
['a', 'b', 'c', 'd', 'e', 'f']
>>> re.findall(r'\G\w', 'abc def')
['a', 'b', 'c']

Notice how it failed to match at the space, so no more results.

Added file: http://bugs.python.org/file13216/issue2636-features-5.diff

_______________________________________
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