I am trying to match two types of URL in these formats:
http://example.com/First/Second/File.Exthttp://example.com/First/Second/Third/File.ExtWhile I could simply encompass the URL by its containing text, I require the individual portions of the URL to rearrange. As such, the regular expression must match each portion. Another issue is the URLs are all received on a single line, so optional text (
(.*?/)? for
Third/) causes it to match across to the next URL. I also don't have the option of running multiple scans, so I can't just extract all full URLs and go from there sadly.
So basically, I need to retrieve First, Second, and if Third exists, that as well. Otherwise, don't keep looking for Third into the next URL.