Regular Expressions 101

Community Patterns

url matcher

0

Regular Expression
ECMAScript (JavaScript)

/
^((?: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 - 2 years ago