我想创建一个正则表达式来匹配一个字符串,该字符串与Localize("
切分,并且应该在"
弹出时结束,而不是在"
转义时结束(前面是\
)。你知道吗
我当前的正则表达式不考虑“除非前面有”这样的计数,如下所示:
\bLocalize\(\"(.+?)(?=\")
有什么想法吗?你知道吗
使用以下字符串:
Localize("/Windows/Actions/DeleteActionWarning=The action you are trying to \"delete\" is referenced in this document.") + " Want to Proceed ?";
我希望它在document.
到来后停止,因为它是第一个"
出现而没有后面的\
(出现在delete
附近)
可以使用not regex操作符^
你可以用
见this regex demo。你知道吗
详细信息:
\bLocalize
-一个完整的单词Localize
\("
-a("
子串([^"\\]*(?:\\.[^"\\]*)*)
-捕获组1:[^"\\]*
-0个或更多字符,而不是"
和\
(?:\\.[^"\\]*)*
-转义字符的0个或多个重复,后跟除"
和\
以外的0个或多个字符在Python中,用
Demo:
相关问题 更多 >
编程相关推荐