Doc #53751 [Opn]: pcre pattern modifier U doesn't mention backtrack limit

From: Date: Sat, 15 Jan 2011 22:21:40 +0000
Subject: Doc #53751 [Opn]: pcre pattern modifier U doesn't mention backtrack limit
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-5813@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=53751&edit=1 ID: 53751 User updated by: php at richardneill dot org Reported by: php at richardneill dot org Summary: pcre pattern modifier U doesn't mention backtrack limit Status: Open Type: Documentation Problem Package: Documentation problem PHP Version: Irrelevant Block user comment: N Private report: N New Comment: Something like: Ungreedy matching is normally limited to strings of < 100k characters; this is configured by [link]pcre.backtrack_limit[/link] A similar warning should also go in the section on regexp repetition here: http://uk3.php.net/manual/en/regexp.reference.repetition.php I think it's worth putting this warning in both places, because perl-hackers will tend to use REs like ".*?", whereas people arriving from other languages are more likely to discover greed/laziness by reading about the pattern-modifiers. Also, if one does exceed this limit, PHP doesn't complain about it: not even an E_NOTICE! Incidentally, I have no performance problem with raising this value from 100k to 100M, and I can still match a 90M character string in under 3 seconds on a netbook. Previous Comments: ------------------------------------------------------------------------ [2011-01-15 23:08:10] frozenfire@php.net Could you please provide more information as to what you think should be added? If there's something that one will likely run into when using the ungreedy modifier, which would benefit others to know, it will certainly be added. :) ------------------------------------------------------------------------ [2011-01-14 18:22:56] php at richardneill dot org Description: ------------ The documentation for pcre patterns http://www.php.net/manual/en/reference.pcre.pattern.modifiers.php has a section on Ungreediness ("U"). This ought to contain some mention of pcre.backtrack_limit (it would have saved me many hours if it had!) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=53751&edit=1

« previous php.doc.bugs (#5813) next »