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 by it's text. To recognize button with currencies, I use Regular expression ":[A-Z]{3}", but it don't work properly when second button contain text "BUY" (regex description returns more than one object).
Question: how can I write pattern for Regular expression, which means: match only when text contain three upper letters, but not text "BUY"?
Thanks!
(?!BUY)
is negative lookahead that would fail if it matches the regexBUY
You can use a negative look-behind assertion to verify that the text just matched does not equal BUY.