gulp-regexp-replace
This plugin allows to apply regexp replace expressions on files & supports regexps to do so.
This is a simple wrapper on regexp-sourcemaps.
Usage
var gulp = require('gulp');
var gulpSourcemaps = require('gulp-sourcemaps');
var gulpRegexp = require('gulp-regexp-sourcemaps');
gulp.src('someGlob')
.pipe(gulpSourcemaps.init())
.pipe(gulpRegexp(
/myRegexp/,
'replace with $1 and ${2}3!!!',
'myRegexpNameForRefInSourceMap'))
.pipe(gulpSourcemaps.write())
.pipe(gulp.dest('myBuildFolder'))
;
Refer to the regexp-sourcemaps/Replacer documentation
for more information on the plugin's arguments.