grpc-js-core: simplify regular expression usage
grpc-js-core: simplify regular expression usage

This commit moves two regular expressions out of the functions
they are used in, and defines them as constants. This commit
also switches from match() to test(), as a Boolean result is
all that's needed.

grpc/grpc-node,grpc/grpc-node,grpc/grpc-node,grpc/grpc-node