diff options
author | Raymond Hettinger <python@rcn.com> | 2014-07-14 08:52:00 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2014-07-14 08:52:00 (GMT) |
commit | 8323f68f3e50f73ce549d885c40bb17c06894376 (patch) | |
tree | 0d2935fc7e92a69abe6c511dfaff2dc7038ee948 /Doc/library/re.rst | |
parent | 5283c4e108bf541ab43cb89e58745f20b4d559b4 (diff) | |
download | cpython-8323f68f3e50f73ce549d885c40bb17c06894376.zip cpython-8323f68f3e50f73ce549d885c40bb17c06894376.tar.gz cpython-8323f68f3e50f73ce549d885c40bb17c06894376.tar.bz2 |
Issue 21977: Minor improvements to the regexes in the tokenizer example.
Diffstat (limited to 'Doc/library/re.rst')
-rw-r--r-- | Doc/library/re.rst | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Doc/library/re.rst b/Doc/library/re.rst index 451ee2d..a835c14 100644 --- a/Doc/library/re.rst +++ b/Doc/library/re.rst @@ -1340,9 +1340,9 @@ successive matches:: ('ASSIGN', r':='), # Assignment operator ('END', r';'), # Statement terminator ('ID', r'[A-Za-z]+'), # Identifiers - ('OP', r'[+*\/\-]'), # Arithmetic operators + ('OP', r'[+\-*/]'), # Arithmetic operators ('NEWLINE', r'\n'), # Line endings - ('SKIP', r'[ \t]'), # Skip over spaces and tabs + ('SKIP', r'[ \t]+'), # Skip over spaces and tabs ] tok_regex = '|'.join('(?P<%s>%s)' % pair for pair in token_specification) get_token = re.compile(tok_regex).match |