I am using this file matching in gulp:
\'content/css/*.css\'
But I would like to only include the files that do not start
If Gulp wildcards are like shell wildcards:
content/css/[^_]*.css
The ^
at the beginning of a character set means to match any characters not in the set.
You could use this regex.
content/css/[^_].*\.css
Add $
at the last if necessary.
You can add a second glob whitch will filter files or folders with an underscore.
For ignore folders I use:
gulp.src(['./src/**/*.html', '!**/_*/**'])
'!**/_*/**'
will filter folders that start with an underscore.
Use this plugin https://github.com/robrich/gulp-ignore
var gulpIgnore = require('gulp-ignore');
var condition = '_*.css'; //exclude condition
gulp.task('less', function() {
gulp.src('content/less/*.less')
.pipe(gulpIgnore.exclude(condition))
.pipe(less())
.pipe(gulp.dest('/dist/'));
});
I think gulp supports file glob not full-regex, But You can give a try to content/css/[^_]*.less