-1

I am trying to search 100$ through the RegEx. But unable to find its pattern is as above.

\b100\$\b

However, if the text contains 100$1 then it displays properly. But I want to do exact search.

Nilay
  • 1,512
  • 2
  • 18
  • 26

1 Answers1

0

Word boundaries only work with word characters, not $. Try using this regex:

\b100\$(?=\s|\$)

This will match 100$, where what follows the $ is either whitespace or the end of the line.

Demo

Tim Biegeleisen
  • 451,927
  • 24
  • 239
  • 318