add support for pattern-substitutions
add a basic unit-test