works on a regular expression for matching