【发布时间】:2021-11-01 21:49:18
【问题描述】:
我正在使用这个表达式来查找路径。
([^\s\&\=\;\,\<\<\>\"\'\(\)]+\/[\w\/])([^\"\'\n\;\}\)\s]*)
目前的比赛是:
位置:/user/login.php xx... /user/login xx... text/html abcd type text/html 嘿abc/def
我想忽略前缀为“type ”的匹配
所以应该是这样的。
位置:/user/login.php xx... /user/login xx... text/html abcd type text /html 嘿 abc/def
【问题讨论】:
-
您使用哪种工具/语言?最明显的解决方案是使用否定的look-behind,但并非所有正则表达式都支持此功能,有时语法甚至会有所不同。
-
c#,是的,正如你所说,消极的后视解决了我的问题。