Remove regex usage in Generator