Moved the regular expression out of the method.