Simple wildcard matching
| From: | Hartmut Holzgraefe | Date: | Thu, 13 Sep 2001 14:16:42 +0000 |
| Subject: | Simple wildcard matching | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-65877@lists.php.net to get a copy of this message | ||
One of my customers requested a search form with simple wildcard
matching yesterday (just the simple '*' and '?' style Windows users are
used to) and i ended up using str_replace() and friends to convert
these into regular expressions while preventing things like '.' from
being interpreted.
First i wondered why there is no [p|e]reg function for encoding all
the special chars available in regular expressions (which i still do)
but then i found that what i was really looking for was a simple
PHP wrapper for C's fnmatch() function.
Now the simple question is: how should i call it and where should it
live?
( ) as fnmatch() in ext/standard, as it is a file related function
after all
( ) as wildcard_match() in ext/standard
( ) as wildcard_match() in a extension of its own
( ) _____________________________________________
comments, suggestions, ideas?
--
Hartmut Holzgraefe hartmut@six.de http://www.six.de
+49-711-99091-77