If i have a css file, like this (for example):
div {
color: red;
}
a{color: red}.someClass {color: red}
.someOtherClass {
color: red;
}
@media (max-width: 767px){
div { color: green; }
[data-module="123"] .someOtherClass { color: green; }
}
[data-module='123'] .someRandomClass { color: red }
[data-module='123'] .someOtherRandomClass {
color: red;
}
Only these last three would match the correct usage of CSS in our company:
[data-module='123'] .someOtherClass {
[data-module="123"] .someRandomClass {
[data-module='123'] .someOtherRandomClass {
Because they start with [data-module='xxx'] (notice users can use " or ') I have been able to find/edit a REGEX that matches these last three correctly, but I need the opposite, I want to match the selectors that dont start with [data-module="xxx"]... So when I'm checking with PHP/Regex, If it matches, I will have to tell the user that he is not following the rules ... The regex has to consider that this CSS might be unorganized like in the example and also there could be media queries..
Can any magic human being help me figure this out? Cause this is magic..some kind of sourcery.. can't figure it out
EDIT: I want something like this Regex: http://regexr.com/328s7
But only match, if the selector doesnt have [data-module="xxx"] before it