I have a link. Ex: http://my.domain/url.jsp
My goal is create patter that will be not allow any URLs with extension like this: .ex1, .ex2, .ex3
I was searching a long of time and find some approach, but it's really opposite that I want.
([^\s]+(\.(?i)(ex1|ex2|ex3))$)
If lookbehind is supported then this regex should work:
^\S+$(?<!\.(?:ex1|ex2|ex3)$)
If lookbehind isn't supported (e.g. Javascript) then use this lookahead based regex:
^(?!.*?\.(?:ex1|ex2|ex3)$)\S+$
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With