Change Matcher implementation.

Matcher now uses regex as an underlying matcher. This is the
intermediate form between inefficient and efficient implementation.