已經得到了一些服務器配置:如何通過開始獲取所有重複的正則表達式模式?
((100010,test1.com,((Method,is,INVITE),(To,is,"0000000000*")),(("Redirect to","ccincoming#[email protected]"))),(100010,test2.com,((Method,is,INVITE),(To,is,"00000000000*")),(("Redirect to","ccincoming#[email protected]")),"some text"),(100010,test3.com,((Method,is,INVITE),("Submit Address","is not","LOCAL [0.0.0.0]*"),(Authenticated,is,"*@test3.com")),(("Redirect to","ccincoming#[email protected]"),("Discard Rules"))),(100000,sometext,(("Submit Address",is,sometext)),(("Redirect to","ccincoming#[email protected]"),("Discard Rules"))),(100000,sometext,((Method,is,INVITE),(To,is,"00000000000*")),(("Redirect to","ccincoming#[email protected]"))))
需要去每一個開頭模式「(1000」,並在下一年初結束
試圖「/(\(1000.*。 。\)),\(1000/GU」但它通過只得到奇數場比賽(次)
因此,需要得到這個:
-
(100010,test1.com,((Method,is,INVITE),(To,is,「0000000000 *」)),((「Redirect to」,「ccincoming#[email protected]」)))
-
(100010,test2.com,((方法是,INVITE),(對,就是 「00000000000 *」)),(( 「重定向到」,「ccincoming#PBX @ TEST2 .COM 「)),」 一些文本 「)
-
(100010,test3.com,((方法是,INVITE),(」 提交地址 「 」不是「,」 LOCAL [ 0.0.0.0] 「),(Authenticated,is,」 @ test3.com「)),((」Redirect到」, 「ccincoming#[email protected]」),( 「丟棄規則」)))
-
(100000,sometext,(( 「提交地址」,就是sometext)),( ( 「重定向到」, 「ccincoming#PBX @ someText」 則會),( 「丟棄規則」)))
-
(100000,sometext,((方法是,INVITE),(要,是,「(」Redirect to「,」ccincoming#[email protected]「)))
感謝您的幫助!
https://regex101.com/r/xciBIF/1
這正則表達式的種類您使用的?它支持lookahead嗎? –