Split match into raw_match.
Added pattern substitution.