开发者

Reg Exp matching multiple instances

开发者 https://www.devze.com 2023-03-12 06:00 出处:网络
I have to match multiple instances of either \"int(\" or \"der(\" So the expression must match these strings

I have to match multiple instances of either "int(" or "der("

So the expression must match these strings

VVEH + int(ACC_X) + der(FL_WSP)
VVEH + int(ACC_X) + i开发者_开发百科nt(FL_WSP)
VVEH + der(ACC_X) + der(FL_WSP)

and not these

VVEH + int(ACC_X) + log(FL_WSP)
VVEH + der(ACC_X) + log(FL_WSP)


VVEH( \+ (int|der)\([^)]+\)){2,}


VVEH            #Initial string
(
    \+          #Escape the 'plus'
    (int|der)   #Either of your function names
    \(          #Escape the bracket
    [^)]+       #Match anything inside the brackets
    \)          #Escape the bracket
){2,}           #All of that stuff above at least twice
0

精彩评论

暂无评论...
验证码 换一张
取 消