yes definately. if your looking for some example regex patterns, you will need to be more specific.
i would really recomend doing this yourself though. this place helped me out a lot.
http://www.regular-expressions.info/tutorial.html
but maybe you are doing this the hard way.
css is powerfull, and maybe you are overlooking the (possibly) best way to do this.
instead of replacing
class="redtext"
with
class="bluetext"
maybe you should just define the class as
class="coloredtext" and then switch the entire stylesheet.
that is afterall, one of the most powerfull benefits of css. and imo, how it should be done.
i usually use 2 or sometimes more stylesheets. ill have one w/ styles that are highly likely to be need or used site wide. then i will have smaller individual stylesheets on a per page basis, or whatever fits the bill. but that way i can have the same class names, yet change thier appearance by switching the stylesheet if needed