For example, I have a string /wiki/File:test.JPG, I have to check if it has one of the extensions"jpeg","jpg","png","gif"
I currently wrote that link.search(/.[j,p,g][p,i,n][e,g,f][g]?/gi), and it works, but I would like to improve the regex.
source
share