Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8323f68

Browse files
committed
Issue 21977: Minor improvements to the regexes in the tokenizer example.
1 parent 5283c4e commit 8323f68

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Doc/library/re.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1340,9 +1340,9 @@ successive matches::
13401340
('ASSIGN', r':='), # Assignment operator
13411341
('END', r';'), # Statement terminator
13421342
('ID', r'[A-Za-z]+'), # Identifiers
1343-
('OP', r'[+*\/\-]'), # Arithmetic operators
1343+
('OP', r'[+\-*/]'), # Arithmetic operators
13441344
('NEWLINE', r'\n'), # Line endings
1345-
('SKIP', r'[ \t]'), # Skip over spaces and tabs
1345+
('SKIP', r'[ \t]+'), # Skip over spaces and tabs
13461346
]
13471347
tok_regex = '|'.join('(?P<%s>%s)' % pair for pair in token_specification)
13481348
get_token = re.compile(tok_regex).match

0 commit comments

Comments
 (0)