<?php
$str='<p>32323223<img src="/Upload/image/ueditor/20180222/1519283654325793.jpg" title="1519283654325793.jpg" alt="beian.jpg"/></p>';
//这个正则表达式中“[jpg|jpeg|png|bmp|gif]*”这个部分是什么意思?
$preg='/\/Upload\/image\/ueditor\/\d*\/\d*\.[jpg|jpeg|png|bmp|gif]*/i';
preg_match($preg, $str,$data);
var_dump($data); //这里能匹配出jpg等后缀 结果如下:array(1) { [0]=> string(51) "/Upload/image/ueditor/20180222/1519283654325793.jpg" }
//但是正则中[] 中括号内的字符,应该只能匹配所包含的任意一个字符的啊,为什么能把jpg整个匹配出来?
森林海
红糖糍粑