<?php
$regex = '~
(\h*\( # capture groups, open brackets
.*? # match everything lazily
(?:(?i)picture|see|lorem(?i-) # up to one of the words, case insensitive
.*? # and anything lazily afterwards
\)) # up to a closing bracket
~x'; # verbose modifier
$text[] = 'Hello world (see below).';
$text[] = 'Lorem ipsum (there is a picture here) world!';
$text[] = 'Attack on titan (is lorem) great but (should not be removed).';
for ($i=0;$i<count($text);$i++)
?>
PD9waHAKJHJlZ2V4ID0gJ34KICAgICAgICAgICAgKFxoKlwoICAgICAgICAgICAgICAgICAgICAgICAgICAgICMgY2FwdHVyZSBncm91cHMsIG9wZW4gYnJhY2tldHMKICAgICAgICAgICAgICAgIC4qPyAgICAgICAgICAgICAgICAgICAgICAgICAgICMgbWF0Y2ggZXZlcnl0aGluZyBsYXppbHkKICAgICAgICAgICAgICAgICg/Oig/aSlwaWN0dXJlfHNlZXxsb3JlbSg/aS0pICMgdXAgdG8gb25lIG9mIHRoZSB3b3JkcywgY2FzZSBpbnNlbnNpdGl2ZQogICAgICAgICAgICAgICAgLio/ICAgICAgICAgICAgICAgICAgICAgICAgICAgIyBhbmQgYW55dGhpbmcgbGF6aWx5IGFmdGVyd2FyZHMKICAgICAgICAgICAgXCkpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICMgdXAgdG8gYSBjbG9zaW5nIGJyYWNrZXQKICAgICAgICAgICAgfngnOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICMgdmVyYm9zZSBtb2RpZmllcgoKJHRleHQgPSBhcnJheSgpOwokdGV4dFtdID0gJ0hlbGxvIHdvcmxkIChzZWUgYmVsb3cpLic7CiR0ZXh0W10gPSAnTG9yZW0gaXBzdW0gKHRoZXJlIGlzIGEgcGljdHVyZSBoZXJlKSB3b3JsZCEnOwokdGV4dFtdID0gJ0F0dGFjayBvbiB0aXRhbiAoaXMgbG9yZW0pIGdyZWF0IGJ1dCAoc2hvdWxkIG5vdCBiZSByZW1vdmVkKS4nOwoKZm9yICgkaT0wOyRpPGNvdW50KCR0ZXh0KTskaSsrKQogICAgJHRleHRbJGldID0gcHJlZ19yZXBsYWNlKCRyZWdleCwgJycsICR0ZXh0WyRpXSk7CgpwcmludF9yKCR0ZXh0KTsKPz4=