 <p>The RegEx is working as written: </p> <pre><code>/^[^t]{2,2}st$/ </code></pre> <ul> <li>^ assert position at start of the string</li> <li>[^t]{2,2} match a single character not present in the list below Quantifier: {2,2} Exactly 2 times</li> <li>t the literal character t (case sensitive)</li> <li>st matches the characters st literally (case sensitive)</li> <li>$ assert position at end of the string</li> </ul> <p>You also don't need to do {2,2} as that is a range, you can do {2} for exactly 2 matches, or {1,2} for 1 upto 2 matches.</p> <p><a href="https://regex101.com/r/zB1sB3/1" rel="nofollow">REGEX101</a></p> <p>This example should serve as a good illustration of what is occurring within that RegEx.</p> <p><strong>If you are looking for a solution to:</strong> Match any word that does not start with tt (case sensitive) you can use the following:</p> <pre><code>/^(?!tt)\w+$/ </code></pre> <p><a href="https://regex101.com/r/zB1sB3/2" rel="nofollow">PROOF</a></p> <p>Hope this helps.</p>