*** /home/aresnick/Desktop/python-2.6.1-docs-text/library/re.txt 2009-01-04 01:25:41.000000000 -0500 --- modified-re.txt 2009-02-10 12:38:30.000000000 -0500 *************** *** 242,254 **** or referenced later in the pattern. ``(?P...)`` Similar to regular parentheses, but the substring matched by the ! group is accessible via the symbolic group name *name*. Group ! names must be valid Python identifiers, and each group name must be ! defined only once within a regular expression. A symbolic group is ! also a numbered group, just as if the group were not named. So the ! group named 'id' in the example below can also be referenced as the ! numbered group 1. For example, if the pattern is ``(?P[a-zA-Z_]\w*)``, the group can be referenced by its name in arguments to methods of match --- 242,256 ---- or referenced later in the pattern. ``(?P...)`` + Similar to regular parentheses, but the substring matched by the ! group is accessible within the rest of the regular expression via ! the symbolic group name *name*. Group names must be valid Python ! identifiers, and each group name must be defined only once within a ! regular expression. A symbolic group is also a numbered group, ! just as if the group were not named. So the group named 'id' in ! the example below can also be referenced (within the regular ! expression) as the numbered group 1. For example, if the pattern is ``(?P[a-zA-Z_]\w*)``, the group can be referenced by its name in arguments to methods of match *************** *** 256,264 **** name in pattern text (for example, ``(?P=id)``) and replacement text (such as ``\g``). ! ``(?P=name)`` Matches whatever text was matched by the earlier group named ! *name*. ``(?#...)`` A comment; the contents of the parentheses are simply ignored. --- 258,268 ---- name in pattern text (for example, ``(?P=id)``) and replacement text (such as ``\g``). ! ``(?P=name)`` Matches whatever text was matched by the earlier group named ! *name*. This can only be used within the regular expression. To ! reference the captured group, pass the group's name as an argument ! to the method of a match object, e.g. ``m.group('name')``. ``(?#...)`` A comment; the contents of the parentheses are simply ignored.