Refactor RepeatedCharactersFilter to access Pattern outside of class

Add documentation to generatePattern()