checking for key in regexp