Use match() instead of exec() for a regex.