From 8323f68f3e50f73ce549d885c40bb17c06894376 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Mon, 14 Jul 2014 01:52:00 -0700 Subject: [PATCH] Issue 21977: Minor improvements to the regexes in the tokenizer example. --- Doc/library/re.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/re.rst b/Doc/library/re.rst index 451ee2d2a34..a835c14f0ca 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