to check whether a string is regular expression or not