Regular Expressions 101

Community Patterns

Finding URLs within full text

1

Regular Expression
ECMAScript (JavaScript)

/
\b(https?|ftp|file)://\S+
/
g

Description

Finds URLs in a larger body of text. URLs may or may not be enclosed in punctuation, such as parentheses, that are not part of the URL.

Submitted by D0nB1z - 9 years ago