in reply to Match domain names except one

"There are many URL's but we should not match with the string (wt)."

The following solves your problem - as stated.

$ perl -Mstrict -Mwarnings -E ' my @urls = qw{ https://www.abc.com.wi.pr.com/ https://www.abc.com/ https://www.def.com.wi.pr.com/ https://www.wt.com.wi.pr.com/ }; for (@urls) { say unless /wt/; } ' https://www.abc.com.wi.pr.com/ https://www.abc.com/ https://www.def.com.wi.pr.com/

I suspect your problem is more complex. If so, please provide more complete details of your requirements; if not, enjoy. :-)

-- Ken