Title: How do I create a preg_replace function to replace a css style
Last modified: August 19, 2016

---

# How do I create a preg_replace function to replace a css style

 *  [karlb](https://wordpress.org/support/users/karlb/)
 * (@karlb)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/how-do-i-create-a-preg_replace-function-to-replace-a-css-style/)
 * Hello,
 * I wondered if anyone could give me any pointers on creating a preg_replace for
   my functions.php file that will allow me to rename a css class name from foo1
   to foo2.
 * I need to do this because of some hard coded css class in a plugin is causing
   me problems so renaming via preg_replace would be ideal.
 * Thank a lot
    Karl

The topic ‘How do I create a preg_replace function to replace a css style’ is closed
to new replies.

## Tags

 * [preg_replace](https://wordpress.org/support/topic-tag/preg_replace/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [karlb](https://wordpress.org/support/users/karlb/)
 * Last activity: [16 years, 2 months ago](https://wordpress.org/support/topic/how-do-i-create-a-preg_replace-function-to-replace-a-css-style/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
