I am using NotepadQQ (Linux flavour of Notepadd++) and have a CSS file that is over 5,500 lines long. My knowledge of regular expressions is limited to the very basics.
I need to search and remove everything that doesn't contain certain hex colour codes.
A sample of the CSS looks like this:
section[id*='rss-'] ul>li .rssSummary {
color:#353535;
padding-left:10px
}
.follow_me .side_body ul li a.sm {
-webkit-transition:background,.5s,ease;
-moz-transition:background,.5s,ease;
transition:background,.5s,ease;
border-radius:50%;
border:3px solid #363b37;
display:block;
height:57px;
margin:0 10px 10px 0;
text-align:center;
width:57px
}
.follow_me .side_body ul li a.sm span {
color:#363b37;
display:block;
font-family:'squared-icomoon';
font-size:40px;
height:57px;
line-height:57px;
width:57px
}
.follow_me .side_body ul li a.fb:hover {
border-color:#4c698c !important;
background:#4c698c
}
.follow_me .side_body ul li a.twitter:hover {
border-color:#00aced !important;
background:#00aced
}
But needs to be
.follow_me .side_body ul li a.sm {
border:3px solid #363b37;
}
.follow_me .side_body ul li a.sm span {
color:#363b37;
}
.follow_me .side_body ul li a.fb:hover {
border-color:#4c698c !important;
background:#4c698c
}
If a selector contains any property lines with certain colours (#363b37, #74a5bf, #6c9ab2, #6995ad, #6691a8 or #4c698c), the selector and those properties and values should remain.
If a selector does not contain any of those colour values, it should be removed in its entirety.
If a property does not contain any of those colour values, the entire line should be removed.
Is this possible using regular expressions in search and replace and if so how? TIA!