RegEx: Grabbing values between quotation marks

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

    MORE ANSWERS! Here is the solution i used

    \"([^\"]*?icon[^\"]*?)\"

    TLDR;
    replace the word icon with what your looking for in said quotes and voila!


    The way this works is it looks for the keyword and doesn't care what else in between the quotes. EG:
    id="fb-icon"
    id="icon-close"
    id="large-icon-close"
    the regex looks for a quote mark "
    then it looks for any possible group of letters thats not "
    until it finds icon
    and any possible group of letters that is not "
    it then looks for a closing "

提交回复
热议问题