Regular Expressions 101

Community Patterns

Cyrillic URLs

1

Regular Expression
Python

r"
^(?:(?:http|https)://)?((?:[A--ЯЁ0-9](?:[A--ЯЁ0-9-]{0,61}[A--ЯЁ0-9])?\.)+(?:[A--ЯЁ]{2,6}\.?|[A--ЯЁ0-9-]{2,}(?<!-)\.?))(?:/?|[/?]\S+)$
"
iu

Description

Matches domain name of URL, supports standart and Cyrillic IDN URLs

Submitted by MrYodda - 8 years ago