RegEx validator in Javascript

PufI = 3 :-)