Get $ sign with -match

  • "this transaction will cost $600" -match "\`$ \d{1,3}"

    I want matches[0]

    $600

    what am I missing ?

  • The double quotes alter $600. Either use single quotes or escape the $ sign.

    "this transaction will cost `$600" -match "\$\d{3}"

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply