I am trying to add some rules to Imagus Firefox Extension. I want to capture image parameter from Google Image Search and if it contains the string th_ remove it and redirect. Otherwise just redirect.
This is my RegEx:
/^(?:(?:images|encrypted)\.)?google\.[^/]+/(?:imgres\?(?:[^&]+&)*?imgurl=)(.*)(?:th_)(.*)&imgrefurl=.*/gm
It works fine for URL's which contain string th_ but for other links it breaks.
Here's the link to my work https://regexr.com/3omf5 Have a look and help.
PS: Please note there are two links in the example.
(?:th_)in your regex?(?:th_)?