Been more than 6 hours trying to find best PHP regex to match a specific class name + :before pseudo. For example I have css code like this
h1 {
font-size: 3em;
line-height: 1.65em;
}
p{line-height: 1.5em; margin: 10px 0;}
.action-admin:before{
content: "";
display: block;
width: 50px;
height: 50px;
}
.action-user:before{
content: "";
display: block;
width: 20px;
height: 20px;
}
footer{
clear: both;
}
so, I want to search all css code that have class name match with '.action-{anyotherwords}:before' and listed them in a php variable (will process this to next action)
so, in simple words - I only want to get these code below from my css above
.action-admin:before{
content: "";
display: block;
width: 50px;
height: 50px;
}
.action-user:before{
content: "";
display: block;
width: 20px;
height: 20px;
}