Workaround for Python regex bug with (a*)* situations.