How to match exact word anywhere in string with PHP regexp
<p>I want to find out if user has used the words <code>admin</code> or <code>username</code> anywhere in their possible username string.</p>

<p>So if user wants to use <code>admin</code>, or <code>I am admin</code>, or <code>my admin name</code> or <code>my username</code>, as their username, I want my regexp to detect it. If he uses <code>adminmember</code> I can live with that, don't detect it. I also want detection to be case insensitive.</p>

<p>So far I got this, but it is not really working as I thought, since it will detect words that it shouldn't:</p>

<p><code>/^[admin|username]+$/i</code></p>

<p>This will match even <code>adm</code>, and it shouldn't. I have tried with word boundaries, but I couldn't make it work either, maybe I did something wrong. As you can see in my question I would like to detect word admin anywhere in the string, but if it is a part of some word I can skip it.</p>

<p>Thanks in advance.</p>