How can I edit the following regex
/(?<=src=")(.*?)(?=")/ui
to get only the matches that ends to jpeg, png, gif like the one below?
!http://.+\.(?:jpe?g|png|gif)!Ui
Thank you
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Replace the .* in the middle ( it represents file name ) – so this will match only if file name ends with jpg, jpeg, png, gif
EDIT:
Solutin with query string is :
And i replaced . with [^”], because double quote is invalid in URI ( and not used often ) – or you can use this ([^”]|(?<=\)|”) for escaped double quote