We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 182b444 commit 9eb841bCopy full SHA for 9eb841b
discord_markdown_ast_parser/lexer.py
@@ -15,10 +15,9 @@ def __call__(self, text: str):
15
def __repr__(self):
16
return f"{self.__class__.__name__}({self.regex and self.regex.pattern!r})"
17
18
-# stolen from https://www.urlregex.com/
19
-URL_REGEX = (
20
- r"http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+"
21
-)
+
+URL_REGEX = r"https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,4}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)"
22
23
class LexingRule(Lexing, Enum):
24
USER_MENTION = r"<@!?(\d{15,20})>"
0 commit comments