negation regexp path with file extension

Viewed 19

I'm little bit in difficult..

^(.+)(\.)(pdf|doc)(.+)?

I would like to match all the other and exclude only DOC and PDF (but I don't know all the extensions... could be more in the time...)

https://www.aaaa.it
https://www.fsdfdsf.it
https://www.fdsgrgty.com
https://www.inth.ie
https://www.caghfd.it
https://www.inteshg.com
https://www.hghhg.it
https://www.dsdgg.it/documents/rr/0/e+I+costi.pdf
https://www.rrrrrrrr.it/documents/ee/0/rrr+I+costi.pdf?Ver=1230

as my code is I match the last 2 lines.

THANKS ALEN

1 Answers

I found this works for me.

/^(?:(?!\.pdf|doc).)*$/

ALEN

Related