B
B
BlagoYar Silence2016-01-10 23:22:07
Domain name market
BlagoYar Silence, 2016-01-10 23:22:07

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.ruor http://webarchive.mail.ru
PS. I make a style for Stylish.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xmoonlight, 2016-01-10
@xmoonlight

$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 question

Ask a Question

731 491 924 answers to any question