I'm going to keep it the way it is so I don't have to define $hasMatch again if it's false the first time.