string.match function wasn't using regexp properly