|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2003-10-04 22:04 UTC] sniper@php.net
  [2003-10-28 18:16 UTC] coldrain at workingonit dot org
  [2004-02-22 15:19 UTC] nlopess@php.net
  [2011-09-29 13:00 UTC] ferenczy at volny dot cz
  [2020-02-07 06:12 UTC] phpdocbot@php.net
  [2020-02-07 07:30 UTC] phpdocbot@php.net
 | |||||||||||||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 21:00:02 2025 UTC | 
Description: ------------ Regular expression from the J.Friedl's "Mastering regular expressions" book that matches pair html tags: #<tag([^>]*)>(((?!</?tag(?:[^>]*)>).)*)</tag>#si When between <tag> and </tag> are more then 2100 bytes (symbols), Apache crashes. Same happens without "s" modifier, if string has no "newline" codes. Reproduce code: --------------- === preg_replace("#<tag([^>]*)>(((?!</?tag(?:[^>]*)>).)*)</tag>#si","","<tag> 2200 symbols</tag>"); === or === function callback (&$m) { return "";}; preg_replace_callback ("#<tag([^>]*)>(((?!</?tag(?:[^>]*)>).)*)</tag>#si","callback","<tag> 2200 symbols </tag>"); === Expected result: ---------------- Match blocks bigger then 2100 symbols long. Actual result: -------------- With more then 2100 sybmols between tags Apache crashes.