If you make StringMatch as a new class, you can test here by using text and pattern. It will much more readable.