mirror of
https://github.com/TECHNOFAB11/bumpver.git
synced 2025-12-12 22:40:09 +01:00
cleanup regex101 url gen
This commit is contained in:
parent
b7af1bbe55
commit
689dd4b73b
1 changed files with 4 additions and 7 deletions
|
|
@ -61,16 +61,13 @@ def pyexpr_regex(regex: str) -> str:
|
|||
return f"re.compile({repr(regex)})"
|
||||
|
||||
|
||||
URL_TEMPLATE = "https://regex101.com/?flavor=python&flags=gmx®ex="
|
||||
|
||||
|
||||
def regex101_url(regex_pattern: str) -> str:
|
||||
try:
|
||||
regex_pattern = format_regex(regex_pattern)
|
||||
except re.error:
|
||||
logger.warning(f"Error formatting regex '{repr(regex_pattern)}'")
|
||||
|
||||
return "".join(
|
||||
(
|
||||
"https://regex101.com/",
|
||||
"?flavor=python",
|
||||
"&flags=gmx" "®ex=" + pysix.quote(regex_pattern),
|
||||
)
|
||||
)
|
||||
return URL_TEMPLATE + pysix.quote(regex_pattern)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue