substitute via caching regexps