Refactoring valid hashtag characters parser