Manuela
Manuela

Reputation: 49

Regex replace curly brackets and double quotes but preserve the text

I have the following demo data:

"${var.some_text.anothertext.test}"
"${var.some_text3}"
"${var.some_text2.anothertext}"

I wanna be able to remove the "${ and the }.

The expected output is: var.some_text.anothertext.test, var.some_text3 and/or var.some_text2.anothertext.

How can I achieve that using Regex?

Upvotes: 0

Views: 667

Answers (1)

Tim Biegeleisen
Tim Biegeleisen

Reputation: 522581

You may try the following find and replace, in regex mode:

Find:    "\$\{(.*?)\}"
Replace: "$1"

Demo

Upvotes: 2

Related Questions