Home >Backend Development >PHP Tutorial > 求问一个正则表达式的有关问题

求问一个正则表达式的有关问题

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-13 12:34:411117browse

求问一个正则表达式的问题
想匹配一个网页地址中的所有图像地址,写了正则表达式如下:

$reg="/<img  src="/static/imghwm/default1.png"  data-src="../Images/Album Cover/album_012.jpg"  class="lazy" \s*.*src\s*=\s*[\"|\']?\s*([^ alt=" 求问一个正则表达式的有关问题 " >\"\']*)/i";


为什么像如下的图像文件地址:
<img  src="/static/imghwm/default1.png"  data-src="../Images/Album Cover/album_012.jpg"  class="lazy"   alt=" 求问一个正则表达式的有关问题 " >

只能匹配到:
 求问一个正则表达式的有关问题 

              

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn