Community Patterns

Community Library Entry

2

Regular Expression
Created·2020-04-30 23:02
Flavor·ECMAScript (JavaScript)

/
(?:(?<=(?:import|export)[^`'"]*from\s+[`'"])(?<path1>[^`'"]+)(?=(?:'|"|`)))|(?:\b(?:import|export)(?:\s+|\s*\(\s*)[`'"](?<path2>[^`'"]+)[`'"])
/
gm
Open regex in editor

Description

It will match the paths of js modules imports, exports and dynamic imports.

Submitted by anonymous