summaryrefslogtreecommitdiff
path: root/src/examples/btpyparse.py
diff options
context:
space:
mode:
authorptmcg <ptmcg@9bf210a0-9d2d-494c-87cf-cfb32e7dff7b>2017-03-03 00:52:59 +0000
committerptmcg <ptmcg@9bf210a0-9d2d-494c-87cf-cfb32e7dff7b>2017-03-03 00:52:59 +0000
commit2cf33fcefb1dace6ec1d714368c20aaf89656692 (patch)
tree48d7b23cbcf588ba9cb0842fe624d8bbcc3280e3 /src/examples/btpyparse.py
parent5c11d34e6d837648cfae2e9728a190c134915ccb (diff)
downloadpyparsing-2cf33fcefb1dace6ec1d714368c20aaf89656692.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)
git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@457 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
Diffstat (limited to 'src/examples/btpyparse.py')
-rw-r--r--src/examples/btpyparse.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/examples/btpyparse.py b/src/examples/btpyparse.py
index 6720c19..4fbbac8 100644
--- a/src/examples/btpyparse.py
+++ b/src/examples/btpyparse.py
@@ -54,16 +54,16 @@ number = Regex('[0-9]+')
# Basis characters (by exclusion) for variable / field names. The following
# list of characters is from the btparse documentation
-any_name = Regex('[^\s"#%\'(),={}]+')
+any_name = Regex('[^\\s"#%\'(),={}]+')
# btparse says, and the test bibs show by experiment, that macro and field names
# cannot start with a digit. In fact entry type names cannot start with a digit
# either (see tests/bibs). Cite keys can start with a digit
-not_digname = Regex('[^\d\s"#%\'(),={}][^\s"#%\'(),={}]*')
+not_digname = Regex('[^\\d\\s"#%\'(),={}][^\\s"#%\'(),={}]*')
# Comment comments out to end of line
comment = (AT + CaselessLiteral('comment') +
- Regex("[\s{(].*").leaveWhitespace())
+ Regex(r"[\s{(].*").leaveWhitespace())
# The name types with their digiteyness
not_dig_lower = not_digname.copy().setParseAction(lambda t: t[0].lower())