Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

/
^((https?|ftp)\:\/\/)?([a-z0-9]{1})((\.[a-z0-9-])|([a-z0-9-]))*\.([a-z]{2,6})(\/?)$
/
g

Description

Регулярное выражение для проверки корректности URL (пример: «http://www.my-site.com»):

Submitted by anonymous - 6 years ago