This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2012年04月01日 08:12 by py.user, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Messages (3) | |||
|---|---|---|---|
| msg157265 - (view) | Author: py.user (py.user) * | Date: 2012年04月01日 08:11 | |
http://docs.python.org/py3k/library/re.html "Note that patterns which start with positive lookbehind assertions will never match at the beginning of the string being searched; you will most likely want to use the search() function rather than the match() function:" >>> re.match(r'(?<=^)abc', 'abc').group() 'abc' >>> re.match(r'(?<=\b)abc', 'abc').group() 'abc' >>> re.match(r'(?<=\A)abc', 'abc').group() 'abc' >>> re.match(r'(?<=\A)abc', 'abc', re.DEBUG).group() assert -1 at at_beginning_string literal 97 literal 98 literal 99 'abc' >>> in some cases match() can match |
|||
| msg159571 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2012年04月29日 04:35 | |
New changeset 7c262962b681 by Ezio Melotti in branch '2.7': #14461: fix wording. http://hg.python.org/cpython/rev/7c262962b681 New changeset 7f35da912739 by Ezio Melotti in branch '3.2': #14461: fix wording. http://hg.python.org/cpython/rev/7f35da912739 New changeset d68b4885fc0f by Ezio Melotti in branch 'default': #14461: merge with 3.2. http://hg.python.org/cpython/rev/d68b4885fc0f |
|||
| msg159572 - (view) | Author: Ezio Melotti (ezio.melotti) * (Python committer) | Date: 2012年04月29日 04:40 | |
Technically you are correct, however using zero-width classes inside a lookbehind doesn't make much sense, because the result would be equivalent even without lookbehind. I replaced 'never' with 'not', because usually it will not match, except in these corner cases that can IMHO be ignored. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:28 | admin | set | github: 58666 |
| 2012年04月29日 04:40:16 | ezio.melotti | set | status: open -> closed assignee: docs@python -> ezio.melotti versions: + Python 2.7, Python 3.3 messages: + msg159572 type: enhancement resolution: fixed stage: resolved |
| 2012年04月29日 04:35:38 | python-dev | set | nosy:
+ python-dev messages: + msg159571 |
| 2012年04月01日 08:12:00 | py.user | create | |