php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #32458 preg_split return only offsets
Submitted: 2005-03-25 21:38 UTC Modified: 2019-03-18 16:17 UTC
Votes:4
Avg. Score:2.5 ± 1.7
Reproduced:1 of 2 (50.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: pornel at despammed dot com Assigned:
Status: Open Package: PCRE related
PHP Version: Irrelevant OS: all
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: pornel at despammed dot com
New email:
PHP Version: OS:

 

 [2005-03-25 21:38 UTC] pornel at despammed dot com
Description:
------------
PREG_SPLIT_OFFSET_CAPTURE is useful for creation of custom parsers - allows to find positions of matching strings.
If offset is known - returned string is not needed, as it might be accessed in various other ways.

I suggest adding flag PREG_SPLIT_OFFSETS_ONLY (or PREG_SPLIT_NO_CAPTURE) that would (hopefully) boost performance when preg_split is used to tokenize long strings.



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-03-25 21:45 UTC] pornel at despammed dot com
New parameter, "start at", that causes command to ignore number of initial chars, would nicely complement this feature.
 [2016-08-07 18:09 UTC] cmb@php.net
-Package: Feature/Change Request +Package: PCRE related
 [2019-03-18 16:17 UTC] nikic@php.net
Related to bug #77744. I don't understand why one would want to have this behavior on preg_split() though, rather than preg_match()/preg_match_all().
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 16:01:27 2024 UTC