I have css file that I am trying to manipulate using php. So if my css is like...
.something {
display:none;
background: blue;
}
.somethingElse {
display:block;
}
I want to be able to get an array of the class names. So my array would look like...
['.something', '.somethingElse']
This is my attempt ($homepage
is my css file)...
$homepage = file_get_contents("style.css");
$regex = '/[\s\S]\K[^{]*(?=})/m';
preg_match_all($regex, $homepage, $matches);
What I tried to do was find all strings that start with any character and end in open brace {
. My regex is all wrong, what is the proper way?