Regular expression to find “src” attribute of HTML “img” element in PHP

前端 未结 4 2008
借酒劲吻你
借酒劲吻你 2020-12-10 20:04

I have a string, inside of that I have an image:

\"

<

4条回答
  •  Happy的楠姐
    2020-12-10 20:36

    The parts that reads ([^\s]+) means select anything that isn't a space.

    Maybe try something like:

    /src="([^"]+)"/
    

    Which is select anything that isn't a double quote.

提交回复
热议问题