Implement formatRegEx.