My actual URLs might look something like this:
http://someurl.com/some/path/file.pdf
or
http://someurl.com/some/path/file.pdf?param=value
or
http://someurl.com/some/path/file.pdf?param=value&second=val
where the file extension may be .pdf or another extension, for example .jpg or .psd, or nothing at all.
I have a url stored without someurl.com part, so some/path/file.pdfpart of the url
How can I use regex to find out the file extension, if present? Is regex the right tool for this?
source
share