-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 Mehta
  • 1,732
  • 2
  • 20
  • 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
  • 502,043
  • 27
  • 286
  • 360