improved regExp matching