|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-03-28 10:09 UTC] tony2001@php.net
[2005-04-05 01:00 UTC] php-bugs at lists dot php dot net
[2005-04-12 20:30 UTC] sam_bravard at yahoo dot com
[2016-09-10 08:35 UTC] alex at alex-at dot ru
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Dec 04 06:00:01 2025 UTC |
Description: ------------ PHP is missing the ability to pre-compile regex expressions and then use the pre-compiled regex. This is a _major_ performance issue (100x) when processing files or text streams with regex's. In PHP you have to recompile the regex for each line you process... a major waste of cpu time. See Perl, .NET or Java's regex support for an example of how to use precompiled regex's. Perhaps PHP can add something like the following and just overload the first argument to preg_match and friends: $precompiled_expression = preg_compile("regex expression"); preg_match($precompiled_expression, $sourcedata, $matches); Reproduce code: --------------- $precompiled_expression = preg_compile("regex expression"); preg_match($precompiled_expression, $sourcedata, $matches); Actual result: -------------- Function doesn't exist... sorely needed for performance.