The TextMatch assignment operator is not an assignment operator, and may cause surprise and inefficiency
This:
TextMatch&
TextMatch :: operator= (const TextMatch& that)
{
set (that.state);
return *this;
}
starts off by doing a clear on the current object and then has to set up all the regex information. Whilst this won't cause problems, it does mean that swap() for instance doesn't do what is expected of it, as you lose information about where you are.