 <p>To match a whole string that doesn't contain <code>101</code>:</p> <pre><code>^(?!.*101).*$ </code></pre> <p>Look-ahead are indeed an easy way to check a condition on a string through regex, but your regex will only match alphanumeric words that do not start with <code>101</code>.</p>