RegExp for matching three letters, but not text “BUY”

前端 未结 2 1225
你的背包
你的背包 2021-02-05 01:36

I have two buttons on form, one of the buttons contain currency code (EUR, USD, GBP,CHF,..) and another one - trade direction (BUY or SELL). And some utility recognize buttons b

2条回答
  •  长发绾君心
    2021-02-05 02:04

    ^(?!BUY)[A-Z]{3}$
    

    (?!BUY) is negative lookahead that would fail if it matches the regex BUY

提交回复
热议问题