RE: [PHP] String?
| From: | Ford, Mike [LSS] | Date: | Thu, 11 Apr 2002 16:05:12 +0000 |
| Subject: | RE: [PHP] String? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-92601@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: jas [mailto:jlgerfen@hotmail.com]
> Sent: 11 April 2002 11:34
> while ($file_names = readdir($dir)) {
> if ($file_names != "." && $file_names !=".." &&
> ereg('_(^[0-9]{4}.jpg$)',
OK, let's take a close, step-by-step look at this ereg pattern:
_ OK -- matches an underscore
( OK -- just a group opener
^ uh-oh -- only matches the *start* of the string, so will always fail!
As far as I can see, you don't need that caret in there at all -- it's not as if
you're even trying to negate the bracketed range which follows.
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.ford@lmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211