Re: preg_match problem
| From: | Richard Lynch | Date: | Tue, 22 Aug 2006 17:23:55 +0000 |
| Subject: | Re: preg_match problem | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-241030@lists.php.net to get a copy of this message | ||
On Mon, August 21, 2006 2:13 pm, Dave Goodchild wrote:
> On 21/08/06, afan@afan.net <afan@afan.net> wrote:
>>
>> hi.
>>
>> I have to check if the script file belongs to any ov form1.php to
>> form6.php files. Need something like:
>> preg_match('/form*.php/', $_SERVER['PHP_SELF'])
>> wher * kan be any number between 1 and 6.
>>
>> Thanks for any help.
>>
>> the pattern is form[1-6]+\.php.
Matches form10.php form11.php form12.php ... form16.php form21.php ...
Leave out the + sign, which means "1 or more"
And I have a religious conviction that you oughta use \\. inside of '
or " though others find it cluttered.
YMMV
--
Like Music?
http://l-i-e.com/artists.htm