我有这样的字符串
Start the function "function name" (any words here ie .*) (0x10)或者'Lets start function "function name" (any words here ie .*) (0x0B)等等等等。function "function name" will start (any words here ie .*) (0x0C).
实际上,我需要一个正则表达式来匹配字符串中特定顺序Start的function单词,而不需要Start单词应该在行首,string2
即Start应该是第一次出现,function单词应该是第二个,无论它们在字符串中的位置如何。
上面的第三个字符串将不匹配,因为Startword 在 word 之后function。如果 Reg ex 匹配,那么我需要捕获"function name"iestring inside double quotes 和(0x10)ie hex valuesinside ()。
我尝试了以下没有帮助的正则表达式
^(?=.*\bStart\b)(?=.*\bfunction\b)"(.*?)".*\((\b0[xX][0-9a-fA-F]+\b)\).*$