Answer the question
In order to leave comments, you need to log in
How to exclude a subdomain using regexp?
There is a line It is http://cloud.mail.ru
necessary to exclude cloud , but leave all others, for example, http://webagent.mail.ru
or http://webarchive.mail.ru
PS. I make a style for Stylish.
Answer the question
In order to leave comments, you need to log in
$re = "/(https?:\\/\\/(?!cloud.mail.ru)[a-z0-9.]+)\\/?/i";
$str = "Есть строка\nhttp://cloud.mail.ru\nНужно исключить cloud, но оставить все другие, например\nhttp://webagent.mail.ru или http://webarchive.mail.ru";
preg_match_all($re, $str, $matches);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question