mirror of
https://github.com/python/cpython.git
synced 2025-08-22 09:45:06 +00:00
String method conversion.
This commit is contained in:
parent
be9b507bdd
commit
b08b2d3166
6 changed files with 35 additions and 38 deletions
|
@ -26,7 +26,7 @@ tok_name[NL] = 'NL'
|
|||
# Imagnumber is new. Expfloat is corrected to reject '0e4'.
|
||||
# Note: to quote a backslash in a regex, it must be doubled in a r'aw' string.
|
||||
|
||||
def group(*choices): return '(' + string.join(choices, '|') + ')'
|
||||
def group(*choices): return '(' + '|'.join(choices) + ')'
|
||||
def any(*choices): return apply(group, choices) + '*'
|
||||
def maybe(*choices): return apply(group, choices) + '?'
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue