Regular Expressions 101

Community Patterns

1...56789...901

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