Regular Expressions 101

Community Patterns

Regex for import statements

0

Regular Expression
ECMAScript (JavaScript)

/
(\s*)(import)(\s*)(\w|\w+[.]\w+)*
/
g

Description

This regex matches the import statements written in Java. The key element is the pattern that matches .xxx.

Submitted by yogitaap - 7 years ago