First, I suppose it is Javascript language.
Next, I find very strange the way you write this regex, and with way too many spaces; programming leaves little room for approximation…
Your example would have been simpler as “new Regex('[A-Z][A-Z0-9]+','i')” and then it would still have been false, missing the extra “^” at the start of the regex to match only at the start of the string.
As for the answer, something like this should do: “new Regex('^[A-Z0-9]{2,}','i')”.
Yves.
|