$patternAlphanum1 = "/^[A-Za-z0-9_\-[color=red][b]'[/b][/color] ]+$/";
🙂
PS: You could shorten up just a tad with:
$patternAlphanum1 = "/^[a-z0-9_' -]+$/i";
The "i" modifier makes it case-insensitive, and if the "-" is the first or last character in a character class, it does not have to be escaped to make it a literal hyphen. You could possibly even replace a-z0-9_ with \w (word character), though it may allow other characters depending on the current locale setting, so that may not be desirable, depending on your requirements.