pixel-unit-regex.js 315 B

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