如何匹配一系列单词后跟一个不同于的单词x
?
例如,我如何匹配at the cost of
后跟一个不同于 的单词some
?
我尝试了以下方法,但无济于事:
<rule id="AT_THE_COST_OF_!SOME" name="at the cost of !some">
<pattern>
<token>at</token>
<token>the</token>
<token>cost</token>
<token>of</token>
<token regexp="yes">/^((?!some).)*$</token>
</pattern>
<message>Did you mean <suggestion>at the cost of some \5</suggestion>?</message>
<example correction='at the cost of some efforts'>Yes, it comes
<marker>at the cost of efforts</marker>.</example>
</rule>