Move all regex code to RegexManager class