Buy All 78 Premium WordPress Themes for $59.99
No Additional Fees, Pay Once and Use Unlimited Time for Unlimited Domains, Free Lifetime Updates

Regex to Find CSS Selector and Declaration

In case you want to find all of the CSS Selectors by a class name and their declarations, it can be easily achieved using an Regex.

Here is an example:

.class1 {
   font-size: 12px;
   text-align: center;
}

...

.class1 {
   font-size: 16px;
   text-align: left;
}

...

.class1 {
   font-size: 22px;
}

You can find all of the .class1 using the following RegEx code:

\.class1 {(.|\n)*?}

Leave a Reply