making the MQ regex more robust