So I’m trying to make it so the I get all the text out of a css class.
For instance,
h1 {
font-weight: bold;
}
I need to get a string which will contain “font-weight: bold;”
I also need to make sure this doesn’t get mixed up with other classes. Basically imagine that was in the middle of a huge css file. How would I get just that class.
(it is ok to ignore things such as h1.blah or variations of h1.)
This would be the RegEx to grab anything inside of a standard h1 declaration. It takes into account spacing and so forth. You probably want more finely-tuned results, but the question lacks the specificity necessary to address the problem further.
/h1\s*{(.+?)}/m