php.net |  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: 2010-12-20 09:40 UTC
Votes:4
Avg. Score:4.2 ± 0.8
Reproduced:2 of 3 (66.7%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: nlopess@php.net Assigned: andrei
Status: Assigned Package: PCRE related
PHP Version: * OS: *
Private report: No CVE-ID:
Have you experienced this issue?
Rate the importance of this bug to you:

 [2005-08-13 14:20 UTC] nlopess@php.net
Description:
------------
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.

patch: http://mega.ist.utl.pt/~ncpl/php_pcre_dfa.txt
example: http://mega.ist.utl.pt/~ncpl/dfa_example.php


TODO:
 - 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.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-08-13 14:21 UTC] nlopess@php.net
Assigning to Andrei, as he's the PCRE extension maintainter.
 [2005-08-15 20:52 UTC] nlopess@php.net
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] jani@php.net
-Package: Feature/Change Request +Package: PCRE related -PHP Version: 5CVS-2005-08-13 (dev) +PHP Version: *
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Tue Aug 29 15:01:52 2017 UTC