mituri

Get all classess from html and search those in styles

Feb 15th, 2023
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. - get class names from html code:
  2. - REGEX: (?:\G(?!\A)|class=")[^"]*?\K([-a-z\d_]*\([-a-z\d_ ]+?\)|[-a-z\d_]+)
  3. - use regex on site: https://regex101.com/r/qRx0Ok/1
  4. - paste html there
  5. - you'll get results on the right side panel "match information"
  6. - click icon to export mathhes
  7. - move exported to array named arr
  8. - next use:
  9.  
  10. arr.reduce((acc, curr) => acc + (curr[0].content + '|'), '')
  11. .slice(0, -1)
  12. // .replace(/minion\||primer\||long-primer\||brevier\||pica\||paragon\||is-image\|/g, "")
  13.  
  14. - then use crtl + f, paste the result to styles file
  15.  
  16.  
Advertisement
Add Comment
Please, Sign In to add comment