|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #33259 & Integer Matching
Submitted: 2005-06-07 03:07 UTC Modified: 2006-11-11 01:56 UTC
From: admin at ninthcircuit dot info Assigned:
Status: Not a bug Package: Feature/Change Request
PHP Version: 5.0.4 OS: Linux
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:
From: admin at ninthcircuit dot info
New email:
PHP Version: OS:


 [2005-06-07 03:07 UTC] admin at ninthcircuit dot info
I was wondering what the PHP community would think of adding an "integer matching" feature.

For instance, we have the asterisk ("*") and the question mark ("?") which denote multiple wildcard matching and single wildcard matching, respectively. Well, how about adding pound ("#") for multi-character integer matching and ampersand ("&") for single integer matching as well?

Output synopsis of corresponding wildcard traits:

Asterisk: foo* {Returns: foo, foo1, foobar, fooasdf, etc.}
Question: foo? {Returns: foo1, fooA, foo^, foo>, foo#, etc.}
Ampersand: foo& {Returns: foo1, foo2, foo3, foo4, foo5, etc.}
Pound: foo# {Returns: foo1,foo234,foo10040,foo71, foo, etc.}

Note the exception in the pound symbol feature: Unlike the asterisk, a pound being added to a regex indicates that AT LEAST one number must exist in the compared string in order for it to match. Naturally the ampersand follows this rule, also.

There are a variety of uses this new feature could have. Traversing arrays with numeric indeces, searching a file, binary searches, etc.



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-06-07 03:10 UTC] admin at ninthcircuit dot info
In the submission where it says "Pound: foo# {Returns...}" Ignore the part where it shows only "foo" .. as this is not a valid matching result to the specification I supplied for "#".

 [2006-11-11 01:56 UTC]
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Mon May 23 18:05:46 2022 UTC