RegExp error: missing terminating ] for character class at offset 7
<p>I am getting  stderr: </p>

<pre><code>PHP Warning:  preg_match(): Compilation failed: missing terminating ] 
for character class at offset 7 in an php file.
</code></pre>

<p>My <code>$regex = '/[' . implode('', $alphabet) . ']{3,}$/S';</code></p>

<p>where <code>$alphabet</code> is an array containing some random letters in each positions (<code>[0] -&gt; R</code>, <code>[1] -&gt; A</code> and so on)</p>

<p>and it throws the error in: <code>if(preg_match($regex, $value))</code> and  <code>$value</code> is a word.</p>

<p>Any ideas whats wrong?</p>

<p>Regards,
Espen</p>
