RegEx: Grabbing values between quotation marks

前端 未结 20 1729
暖寄归人
暖寄归人 2020-11-22 02:13

I have a value like this:

\"Foo Bar\" \"Another Value\" something else

What regex will return the

20条回答
  •  半阙折子戏
    2020-11-22 02:44

    I would go for:

    "([^"]*)"
    

    The [^"] is regex for any character except '"'
    The reason I use this over the non greedy many operator is that I have to keep looking that up just to make sure I get it correct.

提交回复
热议问题