How to verify text containing '$' symbol in it

After ‘getText’ it shows result as ‘$29 - $39’
Text of object ‘Object Repository/UI Before Login/span_29 - 39’ is: ‘$29 - $39’

But when ‘verifyTextPresent’ it gives error and test case stops.
Text ‘$29 - $39’ is not present on page using regular expression.

Could you please help me to resolve this query?

Thanks in advance.

Your error message says you are trying to match your text using RegEx (regular expression). The dollar sign has a meaning when you use RegEx, so either do not use RegEx or you need to escape the dollar sign so it is “seen” as a dollar sign and not RegEx function.

So, either set the boolean to false, like:
WebUI.verifyTextPresent("$29 - $39", false)

or escape the dollar sign, like:
WebUI.verifyTextPresent("\$29 - \$39", true)

Personally, I would go with the first since you are not familiar with RegEx.

In Groovy, the backslash character ( \ ) has special meaning. You need to escape it.

"\\$29 - \\$39"