Regular Expressions 101

Community Patterns

Validate Url with or without http(s)://

1

Regular Expression
PCRE (PHP <7.3)

/
(^$|(http(s)?:\/\/)([\w-]+\.)+[\w-]+([\w- ;,.\/?%&=]*))
/

Description

This will validate whether you starts with http(s)://

Submitted by Sanal Menon Kalipurayath - 9 years ago