Regular Expressions 101

Community Library

x

url matcher

Open Workspace
  • JavaScript
  • Match
0

Regular Expression

/
^((?:https?|ftp|smtp):\/\/)?((?:[a-z0-9]+\.)*[a-z]+|(?:(?:25[0-5]|2[0-4]\d|1?\d{2}|\d)\.){3}(?:25[0-5]|2[0-4]\d|1?\d{2}|\d))(:\d+)?(\/.+\/?)*$
/
gm

Description

improvement of the regular expression seen in this meme: https://old.reddit.com/r/ProgrammerHumor/comments/vxhbku/a_regex_god/

Submitted by Mitsunee