added regular expression checking