mirror of
https://github.com/placeAtlas/atlas.git
synced 2025-01-13 12:13:47 +01:00
Better URL regex
by stephenhay from https://mathiasbynens.be/demo/url-regex
This commit is contained in:
parent
ad5312e0a3
commit
a2e483f156
1 changed files with 2 additions and 2 deletions
|
@ -31,12 +31,12 @@
|
|||
|
||||
VALIDATE_REGEX = {
|
||||
"subreddit": r'^\/r\/([A-Za-z0-9][A-Za-z0-9_]{1,20})(, *\/r\/([A-Za-z0-9][A-Za-z0-9_]{1,20}))*$|^$',
|
||||
"website": r'^http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+$|^$'
|
||||
"website": r'^https?://[^\s/$.?#].[^\s]*$|^$'
|
||||
}
|
||||
|
||||
CL_REGEX = r'\[(.+?)\]\((.+?)\)'
|
||||
CWTS_REGEX = r'^(?:(?:https?:\/\/)?(?:(?:www|old|new|np)\.)?)?reddit\.com\/r\/([A-Za-z0-9][A-Za-z0-9_]{1,20})(?:\/)$'
|
||||
CSTW_REGEX = r'^http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+$'
|
||||
CSTW_REGEX = r'^https?://[^\s/$.?#].[^\s]*$'
|
||||
|
||||
# r/... to /r/...
|
||||
SUBREDDIT_TEMPLATE = r"/r/\1"
|
||||
|
|
Loading…
Reference in a new issue