View Full Version : Regular expression help with image extensions
(! preg_match( "/^<img src/i", $show ) )
hi there i need to select all images with extension .png|.jpg|.gif
How do i alter the above RE to exclude images?
Master_script_maker
06-01-2008, 01:20 PM
preg_match( "/^<img src=(.*)(.png|.jpg|.gif)/i", $show )
thanks but shouldnt i break the dots for the extensions?
Master_script_maker
06-02-2008, 02:17 AM
if you mean escape, then yes.here it is escaped
preg_match( "/^<img src=(.*)(\.png|\.jpg|\.gif)/i", $show )
preg_match( "/\.(png|jpg|gif)/i", $show )
would this work???
1. i just need to detect the extension without the src part
2. and would it be faster to have the dot outside the extention part??
thanks again
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.