|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #34121 Add DFA support to preg_match() function
Submitted: 2005-08-13 14:20 UTC Modified: 2017-10-24 06:00 UTC
Avg. Score:4.2 ± 0.8
Reproduced:2 of 3 (66.7%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: Assigned:
Status: Open Package: PCRE related
PHP Version: * 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.
Block user comment
Status: Assign to:
Bug Type:
New email:
PHP Version: OS:


 [2005-08-13 14:20 UTC]
I've made a patch to add DFA (PCRE 6) support to preg_match().
It isn't completed (yet), because I would like to receive your feedback first before continuing.


 - currently preg_match_*() allocs memory for captures based on the number of capturing parentheses. But this needs to be changed for the DFA mode.
 - make partial matching working. The only thing it needs to be done is to save the workspace table in the cache and reuse it when calling the pcre_dfa_exec() function.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-08-13 14:21 UTC]
Assigning to Andrei, as he's the PCRE extension maintainter.
 [2005-08-15 20:52 UTC]
OK, patch revised.
I've added support for partial matching. This can be usefull, for example, in a CLI app to beep when a user enters a bad char (by doing partial matching when a new char comes in).

TODO: make preg_match_all() fetch all the data (instead of the hardcoded limit). this may be tricky.
 [2010-12-20 09:40 UTC]
-Package: Feature/Change Request +Package: PCRE related -PHP Version: 5CVS-2005-08-13 (dev) +PHP Version: *
 [2017-10-24 06:00 UTC]
-Status: Assigned +Status: Open -Assigned To: andrei +Assigned To:
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu Jul 29 00:01:25 2021 UTC