can someone help me writing single regex to get module(s) from python source line?
from abc.lmn import pqr
from abc.lmn import pqr as xyz
import abc
import abc as xyz
it has 3 sub parts in it
[from(s)<module>(s)] --> get module if this part exist
import(s)<module> --> get module
[(s)as(s)<alias>] --> ignore if this part exist
something like this
:?[from(s)<module>(s)]import(s)<module>:?[(s)as(s)<alias>]
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…