enh/refac: url input handling

This commit is contained in:
Timothy Jaeryang Baek committed 2025-10-04 02:02:26 -05:00
1 parent ce83276fa4
commit a2a2bafdf6
5 files changed
+82 -41

No files matched your search

+8
View File
@@ -531,3 +531,11 @@ def throttle(interval: float = 10.0):
return wrapper
return decorator
def extract_urls(text: str) -> list[str]:
# Regex pattern to match URLs
url_pattern = re.compile(
r"(https?://[^\s]+)", re.IGNORECASE
) # Matches http and https URLs
return url_pattern.findall(text)