uncss, regex pattern for .no-'string', .is-'string'
问题 I'm having some regex woes. Using gulp-uncss I'd like to add some classes to the ignore option. Any class that starts with .no- Any class that contains .is- .no-flexbox {} .test.is-active {} .test .is-hidden {} .pipe(uncss({ html: ['tmp/public_html/*.html'], ignore: ['/(.is-)(\w)*', '(.no-)(\w)*'] })) This isn't quite right 回答1: Your regexes look incomplete. May be you should do like this .pipe(uncss({ html: ['tmp/public_html/*.html'], ignore: ['/\.no-\w+/g', '/\.\w+\s?\.is-\w+/g'] })) 来源: