src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/brackets.ts/prepareBracketForRegExp
function prepareBracketForRegExp(str: string): string {
	const escaped = escapeRegExpCharacters(str);
	// This bracket pair uses letters like e.g. "begin" - "end" (see https://github.com/microsoft/vscode/issues/132162)
	const needsWordBoundaries = (/^[\w ]+$/.test(str));
	return (needsWordBoundaries ? `\\b${escaped}\\b` : escaped);
}