Skip to content

Commit

Permalink
revert reformatting of regexes
Browse files Browse the repository at this point in the history
  • Loading branch information
antoni-szych-rtbhouse committed Jan 31, 2024
1 parent 10e984c commit c850c11
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions voluptuous/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@
import urlparse

# Taken from https://github.com/kvesteri/validators/blob/master/validators/email.py
# fmt: off
USER_REGEX = re.compile(
# start anchor, because fullmatch is not available in python 2.7
"(?:"
# dot-atom
r"(^[-!#$%&'*+/=?^_`{}|~0-9A-Z]+(\.[-!#$%&'*+/=?^_`{}|~0-9A-Z]+)*$"
r"(^[-!#$%&'*+/=?^_`{}|~0-9A-Z]+"
r"(\.[-!#$%&'*+/=?^_`{}|~0-9A-Z]+)*$"
# quoted-string
r'|^"([\001-\010\013\014\016-\037!#-\[\]-\177]|'
r"""\\[\001-\011\013\014\016-\177])*"$)"""
Expand All @@ -56,11 +58,13 @@
# tld
r'(?:[A-Z]{2,6}\.?|[A-Z0-9-]{2,}\.?$)'
# literal form, ipv4 address (SMTP 4.1.3)
r'|^\[(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}\]$'
r'|^\[(25[0-5]|2[0-4]\d|[0-1]?\d?\d)'
r'(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}\]$'
# end anchor, because fullmatch is not available in python 2.7
r")\Z",
re.IGNORECASE,
)
# fmt: on

__author__ = 'tusharmakkar08'

Expand Down

0 comments on commit c850c11

Please sign in to comment.