Added ability to count matched strings by given pattern.

Very simple ability to count matched strings by given pattern.