X Tutup
Skip to content

Commit e858bca

Browse files
committed
forward merge from 3.1
2 parents dd8f2e7 + abd4a05 commit e858bca

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Doc/library/re.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -295,11 +295,12 @@ The special characters are:
295295
match at the beginning of the string being searched.
296296

297297
``(?(id/name)yes-pattern|no-pattern)``
298-
Will try to match with ``yes-pattern`` if the group with given *id* or *name*
299-
exists, and with ``no-pattern`` if it doesn't. ``no-pattern`` is optional and
300-
can be omitted. For example, ``(<)?(\w+@\w+(?:\.\w+)+)(?(1)>)`` is a poor email
301-
matching pattern, which will match with ``'<user@host.com>'`` as well as
302-
``'user@host.com'``, but not with ``'<user@host.com'``.
298+
Will try to match with ``yes-pattern`` if the group with given *id* or
299+
*name* exists, and with ``no-pattern`` if it doesn't. ``no-pattern`` is
300+
optional and can be omitted. For example,
301+
``(<)?(\w+@\w+(?:\.\w+)+)(?(1)>|$)`` is a poor email matching pattern, which
302+
will match with ``'<user@host.com>'`` as well as ``'user@host.com'``, but
303+
not with ``'<user@host.com'`` nor ``'user@host.com>'`` .
303304

304305

305306
The special sequences consist of ``'\'`` and a character from the list below.

0 commit comments

Comments
 (0)
X Tutup