Regular Expressions 101

Community Patterns

Find any URL with no trailing slash

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