kubek2k
kubek2k

Reputation: 5814

Intellij Idea: how to put dollar sign to the replaced content

When You have a replace and you want to replace text with something that contains $ You get a malformed replacement string (interpreter thinks its a variable reference). The $$ doesn't work.

Upvotes: 20

Views: 9660

Answers (2)

forest smoker
forest smoker

Reputation: 139

\ $1 if IDE from JetBrains you need type space character between slash and sign dollar

Upvotes: 2

Vic
Vic

Reputation: 22041

As featured in Regular Expression Syntax Reference - you can use \\$ to escape $ sign.

Upvotes: 21

Related Questions