Regular Expressions 101

Community Patterns

Regex to find URLs in text

1

Regular Expression
ECMAScript (JavaScript)

/
(?:(?:https?|ftp|file):\/\/|www\.|ftp\.)(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[-A-Z0-9+&@#\/%=~_|$?!:,.])*(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[A-Z0-9+&@#\/%=~_|$])*(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[A-Z0-9+&@#\/%=~_|$;-])*
/
gim

Description

Regex to find URLs in text

Submitted by Saheed Odulaja - 7 months ago