Home  >  Q&A  >  body text

javascript - regular expression to match first occurrence of a character

<img src="(.*?)"\s*\/?>

This match is
http://aa.com/posts/2017425/1...f" alt="Ah" title="Ah

How can I locate the first " instead of the last " so as to accurately match the URI image path

巴扎黑巴扎黑2663 days ago995

reply all(1)I'll reply

  • 阿神

    阿神2017-07-05 10:57:32

    I don’t know if you mean this<img src="(.*?)"[^>]*>, $1 now gets the path of the image

    reply
    0
  • Cancelreply