summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorptmcg <ptmcg@austin.rr.com>2023-03-27 07:35:44 -0500
committerptmcg <ptmcg@austin.rr.com>2023-03-27 07:35:44 -0500
commit391fd8029c158b1fc1e657eb0c31faa05857914e (patch)
treebabe3fb7b9e2ebcf02caebca57b48e364c3a9f88
parent24b0b29ea9e6335a465711d3d6e157effeaf583e (diff)
downloadpyparsing-git-391fd8029c158b1fc1e657eb0c31faa05857914e.tar.gz
Add 'url' named capture group to common.url Regex
-rw-r--r--pyparsing/common.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/pyparsing/common.py b/pyparsing/common.py
index 90ac78e..d8c6253 100644
--- a/pyparsing/common.py
+++ b/pyparsing/common.py
@@ -363,6 +363,7 @@ class pyparsing_common:
url = Regex(
# https://mathiasbynens.be/demo/url-regex
# https://gist.github.com/dperini/729294
+ r"(?P<url>" +
# protocol identifier (optional)
# short syntax // still required
r"(?:(?:(?P<scheme>https?|ftp):)?\/\/)" +
@@ -403,7 +404,8 @@ class pyparsing_common:
# query string (optional)
r"(\?(?P<query>[^#]*))?" +
# fragment (optional)
- r"(#(?P<fragment>\S*))?"
+ r"(#(?P<fragment>\S*))?" +
+ r")"
).set_name("url")
"""URL (http/https/ftp scheme)"""
# fmt: on