Regular Expressions 101

Community Patterns

Community Library Entry

7

Regular Expression
ECMAScript (JavaScript)

/
(.+)(?:\/([\w\-\._]+\.js))(?:\?(.+))?
/
gm

Description

Extract resource location, name and query parameters from a URL (JavaScript version)

Submitted by cebence - 11 years ago