From: Senthil Kumaran Date: Sat, 12 Mar 2011 03:40:25 +0000 (+0800) Subject: Fix issue11283 - Clarifying a re pattern in the re module docs for conditional regex X-Git-Tag: v3.2.1b1~322^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=abd4a0556142e971c22d23243bacd3f0ad6d2299;p=python Fix issue11283 - Clarifying a re pattern in the re module docs for conditional regex --- diff --git a/Doc/library/re.rst b/Doc/library/re.rst index 49c241d1d9..1d90f791a7 100644 --- a/Doc/library/re.rst +++ b/Doc/library/re.rst @@ -295,11 +295,12 @@ The special characters are: match at the beginning of the string being searched. ``(?(id/name)yes-pattern|no-pattern)`` - Will try to match with ``yes-pattern`` if the group with given *id* or *name* - exists, and with ``no-pattern`` if it doesn't. ``no-pattern`` is optional and - can be omitted. For example, ``(<)?(\w+@\w+(?:\.\w+)+)(?(1)>)`` is a poor email - matching pattern, which will match with ``''`` as well as - ``'user@host.com'``, but not with ``'|$)`` is a poor email matching pattern, which + will match with ``''`` as well as ``'user@host.com'``, but + not with ``''`` . The special sequences consist of ``'\'`` and a character from the list below.