V
V
Vitya Podpriklopolny2018-09-18 18:23:06
Regular Expressions
Vitya Podpriklopolny, 2018-09-18 18:23:06

A task on a pure regular expression?

wrote an expression for determining links
/(https?:\/\/)?(www\.)?(\w+\.)(\w{2,4})\/?/
Now, it is necessary that all links, except for mysite.loc I
thought to do it through logical AND , but as far as I know, it is not in pure regular expressions. (Or am I wrong?) Help please!
It is possible not on pure regular expressions, but please explain how it works)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2018-09-19
@megamage

/\b(https?:\/\/)?(www\.)?+(?!mysite\.loc)(\w+\.)(\w{2,4})\/?/

https://regex101.com/r/2kbkCh/1

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question