Regular expression to match all domain names except admin / www / mail

I am new to regex, but give me this, I need to find a match:


As a result, I found a regular expression for all domains except admin / www / mail.

I wrote this:



But how to exclude admin, mail, www

I've tried this:



But it doesn't work


source to share

4 answers

try it



Here are some tests

Further reading on regular expressions:

And the trick I used is called Negative LookBehind



Don't just rule out some things, but here is a link to help:

Can the replacement be replaced first? First you can find / replace to eliminate lines that match the things you want to skip, then use your regex.



You would do this to find a line that does not contain admin:



I'm not sure how to do this for multiple lines ...



I use this somewhat similar to the answer already.





All Articles