马宇豪
2024-08-14 e3172de7866b5d04e4d3a4d5eea400c7b3eea227
1
2
3
4
5
6
7
8
9
// excluding regex trick: http://www.rexegg.com/regex-best-trick.html
 
// Not anything inside double quotes
// Not anything inside single quotes
// Not anything inside url()
// Any digit followed by px
// !singlequotes|!doublequotes|!url()|pixelunit
 
module.exports = /"[^"]+"|'[^']+'|url\([^)]+\)|var\([^)]+\)|(\d*\.?\d+)px/g;