I’m looking for a regex that will find and replace certain patterns in a CSS file
E.g in the following string:
.boxOneHeading, .boxTwoHeading, .boxThreeHeading
{
font-size: 18px;
font-family: MuseoSans500;
padding: 10px 15px;
width: 273px;
background-color: #fbfbfb;
background-color: #ffffff;
background-color: #ffcc00;
}
I’m using the following regex: #?[\s]*(.{1})\1{1}(.{1})\2{1}(.{1})\3{1}
This correctly finds:
#ffffff and
#ffcc00
But I’m looking to find only the #ffcc00 values and replace them with #fc0.
What do I add to the regex for this?
Regards,
Jacques
Here is an example:
But I’m looking to find only the #ffcc00 values and replace them with #fc0
I’m a little thrown off by this, isn’t that basically a find/replace at this point?