This is a script code that is not mine, I try to modify it. What it does search for all the tags and then delete them. How would you modify the code to erase only the tags of a given domain or url? for example, delete the domain tags: www.domainurl.com , Remove all tags as:

```
     <a href="https://www.domainurl.com/refer/google-adsense/">fsdf</a>
    <a title="Google Adsense" href="https://www.domainurl.com/refer/google-adsense/" target="_blank" rel="nofollow noopener">fgddf</a>
    <a href="https://www.domainurl.com/page/pago">domain </a>
<a title="Google Adsense" href="https://www.googlead.com/refer/google-adsense/" target="_blank" rel="nofollow noopener">googled</a>

```

result would look like this:

```
fsdf
fgddf
domain
<a title="Google Adsense" href="https://www.googlead.com/refer/google-adsense/" target="_blank" rel="nofollow noopener">google</a>

```

This is the code :

```
if (in_array ( 'OPT_STRIP', $camp_opt )) {
                          echo '<br>Striping links ';

                        //$abcont = strip_tags ( $abcont, '<p><img><b><strong><br><iframe><embed><table><del><i><div>' );

                        preg_match_all('{<a.*?>(.*?)</a>}' , $abcont , $allLinksMatchs);

                        $allLinksTexts    = $allLinksMatchs[1];
                        $allLinksMatchs=$allLinksMatchs[0];

                        $j = 0;
                        foreach ($allLinksMatchs as $singleLink){

                            if(! stristr($singleLink, 'twitter.com'))
                            $abcont = str_replace($singleLink, $allLinksTexts[$j], $abcont);

                            $j++;
                        }
}

```

I tried doing this but it did not work for me:

Regex :

Specifying in the search with preg\_match\_all

```
 preg_match_all('{<a.*?[^>]* href="((https?:\/\/)?([\w\-])+\.{1}domainurl\.([a-z]{2,6})([\/\w\.-]*)*\/?)">(.*?)</a>}' , $abcont , $allLinksMatchs);

```

Any ideas? , I would thank you a lot