| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -85,7 +85,7 @@ def email( | |||
| 85 | 85 | ) | |
| 86 | 86 | if re.match( | |
| 87 | 87 | # dot-atom | |
| 88 | - r"(^[-!#$%&'*+/=?^_`{}|~0-9A-Z]+(\.[-!#$%&'*+/=?^_`{}|~0-9A-Z]+)*$" | ||
| 88 | + r"(^[-!#$%&'*+/=?^_`{}|~0-9a-z]+(\.[-!#$%&'*+/=?^_`{}|~0-9a-z]+)*$" | ||
| 89 | 89 | # quoted-string | |
| 90 | 90 | + r'|^"([\001-\010\013\014\016-\037!#-\[\]-\177]|\\[\001-\011\013\014\016-\177])*"$)', | |
| 91 | 91 | username_part, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -25,7 +25,7 @@ def _simple_hostname_regex(): | |||
| 25 | 25 | """Simple hostname validation regex.""" | |
| 26 | 26 | # {0,59} because two characters are already matched at | |
| 27 | 27 | # the beginning and at the end, making the range {1, 61} | |
| 28 | - return re.compile(r"^(?!-)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,59}[a-zA-Z0-9])?(?<!-)$") | ||
| 28 | + return re.compile(r"^(?!-)[a-z0-9](?:[a-z0-9-]{0,59}[a-z0-9])?(?<!-)$", re.IGNORECASE) | ||
| 29 | 29 | ||
| 30 | 30 | ||
| 31 | 31 | def _port_validator(value: str): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -38,7 +38,7 @@ def iban(value: str, /): | |||
| 38 | 38 | (ValidationError): If `value` is an invalid IBAN code. | |
| 39 | 39 | """ | |
| 40 | 40 | return ( | |
| 41 | - (re.match(r"^[A-Z]{2}[0-9]{2}[A-Z0-9]{11,30}$", value) and _mod_check(value)) | ||
| 41 | + (re.match(r"^[a-z]{2}[0-9]{2}[a-z0-9]{11,30}$", value, re.IGNORECASE) and _mod_check(value)) | ||
| 42 | 42 | if value | |
| 43 | 43 | else False | |
| 44 | 44 | ) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -14,7 +14,7 @@ | |||
| 14 | 14 | def _username_regex(): | |
| 15 | 15 | return re.compile( | |
| 16 | 16 | # dot-atom | |
| 17 | - r"(^[-!#$%&'*+/=?^_`{}|~0-9A-Z]+(\.[-!#$%&'*+/=?^_`{}|~0-9A-Z]+)*$" | ||
| 17 | + r"(^[-!#$%&'*+/=?^_`{}|~0-9a-z]+(\.[-!#$%&'*+/=?^_`{}|~0-9a-z]+)*$" | ||
| 18 | 18 | # non-quoted-string | |
| 19 | 19 | + r"|^([\001-\010\013\014\016-\037!#-\[\]-\177]|\\[\001-\011\013\014\016-\177])*$)", | |
| 20 | 20 | re.IGNORECASE, | |
@@ -25,7 +25,7 @@ def _username_regex(): | |||
| 25 | 25 | def _path_regex(): | |
| 26 | 26 | return re.compile( | |
| 27 | 27 | # allowed symbols | |
| 28 | - r"^[\/a-zA-Z0-9\-\.\_\~\!\$\&\'\(\)\*\+\,\;\=\:\@\%" | ||
| 28 | + r"^[\/a-z0-9\-\.\_\~\!\$\&\'\(\)\*\+\,\;\=\:\@\%" | ||
| 29 | 29 | # emoticons / emoji | |
| 30 | 30 | + r"\U0001F600-\U0001F64F" | |
| 31 | 31 | # multilingual unicode ranges | |
@@ -133,7 +133,9 @@ def _validate_optionals(path: str, query: str, fragment: str, strict_query: bool | |||
| 133 | 133 | optional_segments &= True | |
| 134 | 134 | if fragment: | |
| 135 | 135 | # See RFC3986 Section 3.5 Fragment for allowed characters | |
| 136 | - optional_segments &= bool(re.fullmatch(r"[0-9a-zA-Z?/:@\-._~%!$&'()*+,;=]*", fragment)) | ||
| 136 | + optional_segments &= bool( | ||
| 137 | + re.fullmatch(r"[0-9a-z?/:@\-._~%!$&'()*+,;=]*", fragment, re.IGNORECASE) | ||
| 138 | + ) | ||
| 137 | 139 | return optional_segments | |
| 138 | 140 | ||
| 139 | 141 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments