Title: Preg_replace Error
Last modified: December 15, 2017

---

# Preg_replace Error

 *  [digisavvy](https://wordpress.org/support/users/digisavvy/)
 * (@digisavvy)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/preg_replace-error-3/)
 * Not sure why the other discussion was closed to new replies, but I ran into the
   same issue: **Warning: preg_replace(): The /e modifier is no longer supported,
   use preg_replace_callback instead**
 * Here’s what we have to replace the deprecated preg_replace function:
 *     ```
        $result = preg_replace_callback(
               "'\[swf:(.*?)\]'",
               function($matches) {
                   return stripslashes(wpFlashParseMacro($matches[1]));
                }
               ,
               $content
           );
           return $result;
       ```
   

Viewing 1 replies (of 1 total)

 *  [Frank Neumann-Staude](https://wordpress.org/support/users/fstaude/)
 * (@fstaude)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/preg_replace-error-3/#post-9791546)
 * Same problem here. Your solution works fine. Thank you.

Viewing 1 replies (of 1 total)

The topic ‘Preg_replace Error’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-flash_81504a.svg)
 * [WP Flash & Ruffle](https://wordpress.org/plugins/wp-flash/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-flash/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-flash/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-flash/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-flash/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-flash/reviews/)

## Tags

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

 * 1 reply
 * 2 participants
 * Last reply from: [Frank Neumann-Staude](https://wordpress.org/support/users/fstaude/)
 * Last activity: [8 years, 5 months ago](https://wordpress.org/support/topic/preg_replace-error-3/#post-9791546)
 * Status: not a support question