#33259 [Opn->Bgs]: & Integer Matching

From: Date: Sat, 11 Nov 2006 01:56:31 +0000
Subject: #33259 [Opn->Bgs]: & Integer Matching
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-104805@lists.php.net to get a copy of this message
ID: 33259 Updated by: tony2001@php.net Reported By: admin at ninthcircuit dot info -Status: Open +Status: Bogus Bug Type: Feature/Change Request Operating System: Linux PHP Version: 5.0.4 New Comment: . Previous Comments: ------------------------------------------------------------------------ [2005-06-07 03:10:19] 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 "#". Thanks ------------------------------------------------------------------------ [2005-06-07 03:07:37] admin at ninthcircuit dot info Description: ------------ 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. Thanks -M ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=33259&edit=1

« previous php.bugs (#104805) next »