Regular Expressions 101

Community Patterns

Community Library Entry

2

Regular Expression
ECMAScript (JavaScript)

/
^(https?:\/\/)?(www.)?([\da-zA-z\_\-]+)\.(com|(|[\da-zA-Z]{2,6}))([\/\w \.\-\#\&\?\%\_]*)?([^\/| |\s])$
/
gmi

Description

Not perfect, but better than none.

Submitted by oneglory - 9 years ago