Home > Blockchain >  How to use regex to search all CSS files if any selector does not have a specific property?
How to use regex to search all CSS files if any selector does not have a specific property?

Time:02-19

I'm running into an issue on my site where I've found the line-heights are way off on several heading selectors.

I understand how to run a search on only my stylesheets (which there are a lot of them), but I don't understand if there's a way to use regex to search (I use VS Code) for all h3 selectors that don't have the line-height property?

How do I search all h3 selectors that don't have a nested line-height property?

CodePudding user response:

this :(?<=h3 \{)(\n. ) line-height will detect all the h3 that contain line-height in your style file

screenshot inside vscode

enter image description here

CodePudding user response:

The pattern you're looking for is <h3[^>]*line-height

  • Related