summaryrefslogtreecommitdiff
path: root/pyparsing/core.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyparsing/core.py')
-rw-r--r--pyparsing/core.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/pyparsing/core.py b/pyparsing/core.py
index 4c68e8c..8ab6d41 100644
--- a/pyparsing/core.py
+++ b/pyparsing/core.py
@@ -6057,16 +6057,16 @@ quoted_string = Combine(
).set_name("quoted string using single or double quotes")
python_quoted_string = Combine(
- (Regex(r'"([^"]|""?(?!"))*', flags=re.MULTILINE) + '"""').set_name(
+ (Regex(r'"""(?:[^"\\]|""(?!")|"(?!"")|\\.)*', flags=re.MULTILINE) + '"""').set_name(
"multiline double quoted string"
)
- | (Regex(r"'([^']|''?(?!'))*", flags=re.MULTILINE) + "'''").set_name(
+ ^ (Regex(r"'''(?:[^'\\]|''(?!')|'(?!'')|\\.)*", flags=re.MULTILINE) + "'''").set_name(
"multiline single quoted string"
)
- | (Regex(r'"(?:[^"\n\r\\]|(?:"")|(?:\\(?:[^x]|x[0-9a-fA-F]+)))*') + '"').set_name(
+ ^ (Regex(r'"(?:[^"\n\r\\]|(?:\\")|(?:\\(?:[^x]|x[0-9a-fA-F]+)))*') + '"').set_name(
"double quoted string"
)
- | (Regex(r"'(?:[^'\n\r\\]|(?:'')|(?:\\(?:[^x]|x[0-9a-fA-F]+)))*") + "'").set_name(
+ ^ (Regex(r"'(?:[^'\n\r\\]|(?:\\')|(?:\\(?:[^x]|x[0-9a-fA-F]+)))*") + "'").set_name(
"single quoted string"
)
).set_name("Python quoted string")