Re: regular expression question

From: Date: Wed, 28 Jun 2000 18:57:48 +0000
Subject: Re: regular expression question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-3638@lists.php.net to get a copy of this message
I am trying to match anystring that contians either, for example dir3 or lets say dir12, but if I do "dir[0-9]" I only match if it's dir3 and if I do dir[0-9][0-9] I only get a match if it's dir12. How can I tell it to match either or? I have tried a few different options but none seem to work. If there is a regular expression guru out there. I am sure this is an easy question I just have been beating it to death and haven't seem to get there...
You can either match dir[0-9]{1,2} which should match one or two digits, or simply dir[0-9]+ to match one or more. Shawn

« previous php.general (#3638) next »