Added support for custom patterns.
Merge branch 'add-support-custom-patterns'