summaryrefslogtreecommitdiff
path: root/src/examples/invRegex.py
diff options
context:
space:
mode:
authorPaul McGuire <ptmcg@austin.rr.com>2017-03-03 00:52:59 +0000
committerPaul McGuire <ptmcg@austin.rr.com>2017-03-03 00:52:59 +0000
commit2a15a07e755b2acb18b76d87105253dc420acce8 (patch)
tree48d7b23cbcf588ba9cb0842fe624d8bbcc3280e3 /src/examples/invRegex.py
parentaf93d51cf83fb6ff2e9bcbff56133a42d0ac31f9 (diff)
downloadpyparsing-git-2a15a07e755b2acb18b76d87105253dc420acce8.tar.gz
Fix deprecated use of '\' as described in https://bugs.python.org/issue27364 (Deprecated in Python 3.6, will become SyntaxError in a future release)
Diffstat (limited to 'src/examples/invRegex.py')
-rw-r--r--src/examples/invRegex.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/examples/invRegex.py b/src/examples/invRegex.py
index b6fe1f1..aea3b55 100644
--- a/src/examples/invRegex.py
+++ b/src/examples/invRegex.py
@@ -188,9 +188,9 @@ def count(gen):
return sum(1 for _ in gen)
def invert(regex):
- """Call this routine as a generator to return all the strings that
+ r"""Call this routine as a generator to return all the strings that
match the input regular expression.
- for s in invert("[A-Z]{3}\d{3}"):
+ for s in invert(r"[A-Z]{3}\d{3}"):
print s
"""
invReGenerator = GroupEmitter(parser().parseString(regex)).makeGenerator()