RegEx: Grabbing values between quotation marks

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

    For me worked this one:

    |([\'"])(.*?)\1|i
    

    I've used in a sentence like this one:

    preg_match_all('|([\'"])(.*?)\1|i', $cont, $matches);
    

    and it worked great.

提交回复
热议问题