Skip to content

Commit c2c1655

Browse files
committed
simplified URL regex
1 parent a78ffa1 commit c2c1655

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

comment_spell_check/utils/url_remove.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def remove_urls(text):
1616
The string with URLs removed.
1717
"""
1818
url_pattern = re.compile(
19-
r"(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&\'\(\)\*\+,;=.]+",
19+
r"(?:https?:\/\/)?[\w.-]+\.[\w.-]+[^\s]*",
2020
re.IGNORECASE,
2121
)
2222
return url_pattern.sub("", text)

0 commit comments

Comments
 (0)