Added new method to check regular expression