Skip to content

Commit

Permalink
Merge branch 'piewpiew-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
kvesteri committed Jan 30, 2018
2 parents 92cda69 + 1efa47c commit fc66e1f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion tests/test_domain.py
Expand Up @@ -9,7 +9,8 @@
'xn----gtbspbbmkef.xn--p1ai',
'underscore_subdomain.example.com',
'something.versicherung',
'11.com'
'11.com',
'somerandomexample.xn--fiqs8s'
])
def test_returns_true_on_valid_domain(value):
assert domain(value)
Expand Down
8 changes: 4 additions & 4 deletions validators/domain.py
Expand Up @@ -3,10 +3,10 @@
from .utils import validator

pattern = re.compile(
r'^(([a-zA-Z]{1})|([a-zA-Z]{1}[a-zA-Z]{1})|'
r'([a-zA-Z]{1}[0-9]{1})|([0-9]{1}[a-zA-Z]{1})|'
r'([a-zA-Z0-9][-_.a-zA-Z0-9]{0,61}[a-zA-Z0-9]))\.'
r'([a-zA-Z]{2,13}|[a-zA-Z0-9-]{2,30}.[a-zA-Z]{2,3})$'
r'^(([a-zA-Z]{1})|([a-zA-Z]{1}[a-zA-Z]{1})|' # domain pt.1
r'([a-zA-Z]{1}[0-9]{1})|([0-9]{1}[a-zA-Z]{1})|' # domain pt.2
r'([a-zA-Z0-9][-_.a-zA-Z0-9]{0,61}[a-zA-Z0-9]))\.' # domain pt.3
r'([a-zA-Z]{2,13}|(xn--[a-zA-Z0-9]{2,30}))$' # TLD
)


Expand Down

0 comments on commit fc66e1f

Please sign in to comment.