Regular Expressions 101

URL Validator

Open Workspace
  • PCRE (Legacy)
  • Match
13

Regular Expression

/
(((ftp|http|https):\/\/)|(\/)|(..\/))(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?
/

Description

Validates -

  1. URLs with schemes - http, https and ftp

  2. Relative URL starting with / and ../

Submitted by Anonymous