php - Regex to match URL except for some websites using Look AheadGet the solution ↓↓↓
If you just want to require a URL to have
com in it, but not
mysite in the host part, then you may use
See the regex demo
^- start of string
(?:[^./]+\.)*- zero or more sequences of:
[^./]+- 1+ chars other than
\.- a literal dot
(?!mysite)[^./]+- 1+ chars other than
/that - up to
.com- does not equal
(?:/.*)?- 1 or 0 sequences of
.*- any 0+ chars other than line break chars
$- end of string.
Share solution ↓
Link To Answer People are also looking for solutions of the problem: property [id] does not exist on this collection instance.
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.