RegEx: Grabbing values between quotation marks

前端 未结 20 1579
暖寄归人
暖寄归人 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:32

    All the answer above are good.... except they DOES NOT support all the unicode characters! at ECMA Script (Javascript)

    If you are a Node users, you might want the the modified version of accepted answer that support all unicode characters :

    /(?<=((?<=[\s,.:;"']|^)["']))(?:(?=(\\?))\2.)*?(?=\1)/gmu
    

    Try here.

提交回复
热议问题