Added matchesRegex validation method