Title: Warning: preg_replace: Compilation failed
Last modified: June 21, 2017

---

# Warning: preg_replace: Compilation failed

 *  [vintecinque](https://wordpress.org/support/users/vintecinque/)
 * (@vintecinque)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/warning-preg_replace-compilation-failed/)
 * Guys, I’m getting this error,
 * preg_replace(): Compilation failed: regular expression is too large
    From my 
   insert.php plugin file, line 52
 * Anyone have an idea how to increase their size so they can read?

Viewing 1 replies (of 1 total)

 *  [WillBontrager](https://wordpress.org/support/users/willbontrager/)
 * (@willbontrager)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/warning-preg_replace-compilation-failed/#post-9251873)
 * On line 52 of your PHP code, the PHP compiler sees a regular expression that’s
   too large for it to compile.
 * Insert PHP works by putting the PHP code found between [insert_php] and [/insert_php]
   tags through the PHP eval() function. I speculate that it’s possible using eval()
   reduces the regular expression size the PHP compiler can handle; but I don’t 
   know it for a fact.
 * It may be necessary to split the regular expression into two or more expressions
   so the compiler can handle it.
 * Will
    -  This reply was modified 8 years, 11 months ago by [WillBontrager](https://wordpress.org/support/users/willbontrager/).

Viewing 1 replies (of 1 total)

The topic ‘Warning: preg_replace: Compilation failed’ is closed to new replies.

 * ![](https://ps.w.org/insert-php/assets/icon-256x256.gif?rev=3523853)
 * [Woody Code Snippets – Insert PHP, CSS, JS, and Header/Footer Scripts](https://wordpress.org/plugins/insert-php/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/insert-php/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/insert-php/)
 * [Active Topics](https://wordpress.org/support/plugin/insert-php/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/insert-php/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/insert-php/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [WillBontrager](https://wordpress.org/support/users/willbontrager/)
 * Last activity: [8 years, 11 months ago](https://wordpress.org/support/topic/warning-preg_replace-compilation-failed/#post-9251873)
 * Status: not resolved