Regular Expressions 101

Community Patterns

Python imports

0

Regular Expression
PCRE2 (PHP >=7.3)

/
^(import|from)\s((\w+(,\s)?)*)
/
gm

Description

this regex with find the files/modules imported into a python file

Submitted by anonymous - 3 years ago