modify regex function