[Python-checkins] cpython (3.4): Issue 21977: Minor improvements to the regexes in the tokenizer example.

raymond.hettinger python-checkins at python.org
Mon Jul 14 10:52:52 CEST 2014


http://hg.python.org/cpython/rev/bb28542af060
changeset:   91672:bb28542af060
branch:      3.4
parent:      91669:407110796b16
user:        Raymond Hettinger <python at rcn.com>
date:        Mon Jul 14 01:52:00 2014 -0700
summary:
  Issue 21977:  Minor improvements to the regexes in the tokenizer example.

files:
  Doc/library/re.rst |  4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)


diff --git a/Doc/library/re.rst b/Doc/library/re.rst
--- a/Doc/library/re.rst
+++ b/Doc/library/re.rst
@@ -1340,9 +1340,9 @@
             ('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

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list