 <p>This will work:</p> <pre><code>var re = /^FIXED(?:-[a-zA-Z0-9]{4}){3}$/; </code></pre> <p>You could as well use the charactergroup <code>\w</code> which usually is pretty much equivalent to <code>[a-zA-Z0-9]</code> but that might contain several characters (ASCII &lt;> UTF) you might not want to have.</p>