Special Offer: Get All 151 Premium WordPress Themes for Just $99.99 $59.99 Purchase Now Learn more

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)*?}