Home > 网站建设 > 正则表达式匹配图片

正则表达式匹配图片

第一个:

/(<img.*?src=|\\[img\\]).*?http:\\/\\/(.+?)(\\[\\/img|'|\"|\\s|>)/is

第二个:

/<(img|IMG) (.*?)(src|SRC)=('|\"|\\\\\"|)(.+?)(.jpg|.JPG|.gif|.GIF|.png|.PNG|.bmp|.BMP|.jpeg|.JPEG)(.*?)>/is

 

Categories: 网站建设 Tags:
  1. No comments yet.
  1. No trackbacks yet.

Note: Commenter is allowed to use '@User+blank' to automatically notify your reply to other commenter. e.g, if ABC is one of commenter of this post, then write '@ABC '(exclude ') will automatically send your comment to ABC. Using '@all ' to notify all previous commenters. Be sure that the value of User should exactly match with commenter's name (case sensitive).