Title: preg_replace max execution time exceeded
Last modified: August 22, 2017

---

# preg_replace max execution time exceeded

 *  [bzik](https://wordpress.org/support/users/bzik/)
 * (@bzik)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/preg_replace-max-execution-time-exceeded/)
 * Error in file class-bjll.php:329 with long text article. Regex in this function
   execution time is too slow (more than 30 seconds). I removed /s modificator for“.
   matches newline” and it works now normally. Anyway, html-tags not separated by
   newlines normally. Please, make revision of regexps in code and apply some patches.
   Or even dont use regex in this function.
 * `$regex = '/<\s*\w*\s*class\s*=\s*[\'"](|.*\s)' . $skip_classes_ORed . '(|\s.*)[\'"].*
   >/iU';`
    -  This topic was modified 8 years, 8 months ago by [bzik](https://wordpress.org/support/users/bzik/).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fpreg_replace-max-execution-time-exceeded%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

The topic ‘preg_replace max execution time exceeded’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/bj-lazy-load_9084ba.svg)
 * [BJ Lazy Load](https://wordpress.org/plugins/bj-lazy-load/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/bj-lazy-load/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/bj-lazy-load/)
 * [Active Topics](https://wordpress.org/support/plugin/bj-lazy-load/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/bj-lazy-load/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/bj-lazy-load/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [bzik](https://wordpress.org/support/users/bzik/)
 * Last activity: [8 years, 8 months ago](https://wordpress.org/support/topic/preg_replace-max-execution-time-exceeded/)
 * Status: not resolved