I want to create a regex to match URLs that start with http://, https://, // or to find urls that have an extension different from html, htm, php and php3. URL query substrings are optional
Let's say that I want to find these:
http://example.com
/example.mp3
/example.mp3?q=example
http://example.com/example.mp3
#example
And to reject these:
example
/example
/example/
/example.htm
/example.htm?q=example
/example.mp3/example //The .mp3 needs to be extension to be accepted
/example#example
I already tried this /(^(http:\/\/|https:\/\/|\/\/|#)|(.*)((.*)\.^(?!html|htm|php|php3)$)(\?.*)?$)/igm but it didn't worked.
If the opposite(reversing the accepted and declined lists) is easier to do, even that is very appreciated, I can change the function that handles the regex.
#examplebut not/example#example/or//?