File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -902,11 +902,11 @@ raw string when incorporating backreferences in a RE.)
902902
903903For example, the following RE detects doubled words in a string. ::
904904
905- >>> p = re.compile(r'\b(\w+)\b\ s+\1\b')
905+ >>> p = re.compile(r'\b(\w+)\s+\1\b')
906906 >>> p.search('Paris in the the spring').group()
907907 'the the'
908908
909- The first part of the pattern, ``\b(\w+)\b ``, will match an entire word and
909+ The first part of the pattern, ``\b(\w+) ``, will match an entire word and
910910capture the word as group 1. The pattern then matches some whitespace with
911911``\s+ `` and checks for the word again with ``\1\b ``. The second \b is
912912necessary to ensure that the backreference is matching an entire word;
You can’t perform that action at this time.
0 commit comments