Color the range matched by a regex with a single color.

This simplifies both the implementation and use of color matching,
while making it on the whole more flexible (though some common
patterns, such as coloring brackets differently from their contents,
are now more cumbersome to express).

Fix the escaping of many extended regex metacharacters missed in
previous commits.