Regular Expressions 101

Community Patterns

Match a URL from a text message

3

Regular Expression
ECMAScript (JavaScript)

/
[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b[-a-zA-Z0-9@:%_\+.~#?&//=]*
/
i

Description

I use this to match the first url present in a text message.

Submitted by anonymous - 9 years ago