added search regex function