开发者

Reg Exp matching multiple instances

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜