RE: regex problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[snip]
Hi there,

I do work on following regex:
^(.*)_a[0-9](.*).htm$

This should be valid for "test_a9393.htm", but not for "9393.htm" as 
ther is no leading _a infront of the number.

Unfortunatelly this also works for the 9393.htm file. Can somebody give 
me a hint why the regex also is true for text that does not start with 
_a infront of the number?

Thank you for any help,

Merlin
[/snip]

How about this:

(\w)+(_a){1}(\w)+\.htm$

Worked for me :)

HTH

Dan
-- 
Dan Parry
Senior Developer
Virtua Webtech Ltd
http://www.virtuawebtech.co.uk

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.8.0/352 - Release Date: 30/05/2006
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux