Skip to content

Commit fc66e1f

Browse files
committed
Merge branch 'piewpiew-master'
2 parents 92cda69 + 1efa47c commit fc66e1f

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

tests/test_domain.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
'xn----gtbspbbmkef.xn--p1ai',
1010
'underscore_subdomain.example.com',
1111
'something.versicherung',
12-
'11.com'
12+
'11.com',
13+
'somerandomexample.xn--fiqs8s'
1314
])
1415
def test_returns_true_on_valid_domain(value):
1516
assert domain(value)

validators/domain.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
from .utils import validator
44

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

1212

0 commit comments

Comments
 (0)