error in checkRegex spotted by Radoslaw M