More robust regexes. Assign getter based on regex.test.