gm -> g. gm is useless for what were doing
working around issue in search/replace regex engine where matching a string causes a repeated match to not replace correctly. so, changing all regexes ENDING in a delim search to be zero-width (?=...) which fixes this problem completely.