Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 12 Current »

关键词:Regular Expression, RegExp, 正则表达式

工具

http://www.myregexp.com

https://regex101.com/

实例

匹配Id,但orderId和productId不算,必须包含其他的Id(包含orderId或productId也可以,但不能只有orderId或productId)

 

参考:http://stackoverflow.com/questions/1395177/regex-to-exclude-a-specific-string-constant

另一种解决方案

使用(?<!X),negative lookbehind

https://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html

http://www.rexegg.com/regex-lookarounds.html

  • No labels