匹配特定句子之外的单词
Match word outside of specific sentence
我想知道是否可以匹配句子外的单词。
这是我目前使用的正则表达式:
/(exchange|occasion|second hand)/im
现在我只想匹配这句话之外的这些词:
Shown prices, for exchange of ocassions are only for indication.
但我不确定该怎么做。
您可以像这样在交替的 LHS 上使用 PCRE verb (*SKIP)(*FAIL)
to match and skip anything:
/Shown prices, for exchange of ocassions are only for indication\.(*SKIP)(*F)|\b(exchange|occasion|second hand)\b/i
我想知道是否可以匹配句子外的单词。
这是我目前使用的正则表达式:
/(exchange|occasion|second hand)/im
现在我只想匹配这句话之外的这些词:
Shown prices, for exchange of ocassions are only for indication.
但我不确定该怎么做。
您可以像这样在交替的 LHS 上使用 PCRE verb (*SKIP)(*FAIL)
to match and skip anything:
/Shown prices, for exchange of ocassions are only for indication\.(*SKIP)(*F)|\b(exchange|occasion|second hand)\b/i