Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
ECMAScript (JavaScript)

/
^(?:https?:\/\/)?(?:[\da-z\.-]+)\.(?:[a-z\.]{2,6})(?:[\/\w \.-]*)*\/?(?:\?[\/\w=\-\&]*)?(?:#[\/\w\-]*)?$
/

Description

Matches basic URLs and fails on things that aren't

Submitted by anonymous - 9 years ago