From 40cbbf34a62d023fc52a5e2571b01e726856eac2 Mon Sep 17 00:00:00 2001 From: ptmcg Date: Sun, 26 Jan 2020 19:05:23 -0600 Subject: Added new warning 'warn_on_match_first_with_lshift_operator' to warn when doing `fwd << a | b`; fixed potential FutureWarning when including unescaped '[' in a regex range definition. --- pyparsing/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pyparsing/util.py') diff --git a/pyparsing/util.py b/pyparsing/util.py index 376b9ae..468fefc 100644 --- a/pyparsing/util.py +++ b/pyparsing/util.py @@ -145,7 +145,7 @@ def _collapseAndEscapeRegexRangeChars(s): is_consecutive.value = -1 def escape_re_range_char(c): - return "\\" + c if c in r"\^-]" else c + return "\\" + c if c in r"\^-][" else c ret = [] for _, chars in itertools.groupby(sorted(s), key=is_consecutive): -- cgit v1.2.1