Community Patterns

Community Library Entry

1

Regular Expression
Created·2016-03-02 08:31
Flavor·Python

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

Description

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

Submitted by MrYodda