Involved in the modulation of the chemotaxis system; catalyzes the demethylation of specific methylglutamate residues introduced into the chemoreceptors (methyl-accepting chemotaxis proteins) by CheR. B.subtilis has an effective methylation-independent adaptation system but must utilize the methylation system for adaptation to high concentrations of attractant. [protein]-L-glutamate 5-O-methyl ester + H2O = H(+) + L-glutamyl-[protein] + methanol H2O + L-glutaminyl-[protein] = L-glutamyl-[protein] + NH4(+) Contains a C-terminal catalytic domain, and an N-terminal region which modulates catalytic activity. Phosphorylated by CheA. Phosphorylation of the N-terminal regulatory domain activates the methylesterase activity. Belongs to the CheB family.