php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #65001 string argument length limits for preg_match() are not written in the man page
Submitted: 2013-06-09 22:58 UTC Modified: 2013-06-12 19:19 UTC
From: bakaburg1 at gmail dot com Assigned:
Status: Wont fix Package: Documentation problem
PHP Version: 5.4.16 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: bakaburg1 at gmail dot com
New email:
PHP Version: OS:

 

 [2013-06-09 22:58 UTC] bakaburg1 at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/function.preg-match#refsect1-function.preg-
match-parameters
---

I got crazy to understand why preg_match() in my script wasn't working than I 
realize that the problem could have been in the length of the string I was 
passing 
to it.

A little search and indeed there was a length limiti for the passed string.

Well I think it should be written pretty clearly in the function manual page, 
together with ways to circumvent the problem (increase the limit or 
substr[inging]). It would be quite useful, especially for newbies that could not 
be able to solve the problem by themselves easily.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-06-12 19:19 UTC] aharvey@php.net
-Status: Open +Status: Wont fix
 [2013-06-12 19:19 UTC] aharvey@php.net
There is a warning generated when the pattern size limit is hit. Given that, I 
don't think it's really worth documenting, particularly since libpcre doesn't 
have a hard and fast limit — it varies depending on how it's compiled, and 
boilerplate along the lines of "The maximum pattern length may be limited by the 
libpcre build configuration" seems useless.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 15:01:29 2024 UTC