0

I have string:

"Hello , this is "Hello world". Have a Good day"

I need a regex which will return double quoted string only from string : "Hello world"

What regex will give double quoted string only as output?

Yosef Tukachinsky
  • 5,570
  • 1
  • 13
  • 29
jsBee
  • 413
  • 3
  • 13

1 Answers1

2

Use escape character:

"Hello , this is \"Hello world\". Have a Good day"

Danil Gudz
  • 2,233
  • 16
  • 16
  • 1
    I got my answer. Using match(): msg = "Hello , this is "Hello world". Have a Good day"; msg.match(/"([^']+)"/)[1]; – jsBee Jan 14 '19 at 15:44