(original) (raw)
changeset: 68391:d676601fee6f branch: 3.1 parent: 68384:f040a34102de user: Senthil Kumaran orsenthil@gmail.com date: Sat Mar 12 11:40:25 2011 +0800 files: Doc/library/re.rst description: Fix issue11283 - Clarifying a re pattern in the re module docs for conditional regex diff -r f040a34102de -r d676601fee6f Doc/library/re.rst --- a/Doc/library/re.rst Fri Mar 11 23:42:49 2011 +0100 +++ b/Doc/library/re.rst Sat Mar 12 11:40:25 2011 +0800 @@ -295,11 +295,12 @@ 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 ``'user@host.com'`` as well as - ``'user@host.com'``, but not with ``'<user@host.com'``. +="" will="" try="" to="" match="" with="" ``yes-pattern``="" if="" the="" group="" given="" *id*="" or="" *name*="" exists,="" and="" ``no-pattern``="" it="" doesn't.="" is="" optional="" can="" be="" omitted.="" for="" example,="" ``(<)?(\w+@\w+(?:\.\w+)+)(?(1)="">|$)`` is a poor email matching pattern, which + will match with ``'user@host.com'`` as well as ``'user@host.com'``, but + not with ``'<user@host.com'`` nor="" ``'user@host.com="">'`` . The special sequences consist of ``'\'`` and a character from the list below. </user@host.com'``>/user@host.com</user@host.com'``.>/user@host.com/orsenthil@gmail.com