Closed Thread Icon

Topic awaiting preservation: regular expression (Page 1 of 1) Pages that link to <a href="" title="Pages that link to Topic awaiting preservation: regular expression (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: regular expression <span class="small">(Page 1 of 1)</span>\

Paranoid (IV) Inmate

From: Seattle, WA, USA
Insane since: Oct 2001

posted posted 04-12-2003 03:19

can somebody tell me what's wrong with this regular expression ? It's in php.


so if $series was set to "Series Name"
and $volumenum was set to "01"
I want it to match any string that would be "Series Name01-xxx.jpg" Where xxx is any 3 digit number.

Paranoid (IV) Inmate

From: New Jersey, USA
Insane since: Oct 2000

posted posted 04-12-2003 03:50

In your example "Series Name01-xxx.jpg" you have a space inbetween Series and Name but you don't allow for that in your regexp. Also your regexp will never match unless your target string is on a line by itself.


After looking closer at your post and testing a little bit your regexp works the way you have it written for the test text you have supplied. I think the only problem you may have is as I said before. If the text you are looking for is not on a line by itself, it won't match.



[This message has been edited by butcher (edited 04-12-2003).]

« BackwardsOnwards »

Show Forum Drop Down Menu