Re: Regular expression question

From: Date: Fri, 09 Nov 2001 21:56:08 +0000
Subject: Re: Regular expression question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-74060@lists.php.net to get a copy of this message
What is $num going to be? A number? So how do you determine where that number ends and where there shouldn't be another number in front of it...are there any restrictions on the size of $num? say $num is 51 then you're saying that you want to match 51:: but not 151:: however, what if $num is 151? see what i mean? ----- Original Message ----- From: "Leon Mergen" <leon@blazebox.com> To: <php-general@lists.php.net> Sent: Friday, November 09, 2001 1:53 PM Subject: [PHP] Regular expression question > Hello, > > I have a little question regarding regular expressions... I want to check > for the pattern > > $num:: > > But, $num may not be started with another number (assume the number will be > 51 , 1 will also match (the pattern 1:: is available in 51::) ... Currently, > my regular expression is: > > eregi("([^0-9]$num::)", $string); > > But that doesn't seem to work... The other option, the start of a line or a > : also didn't work: > > eregi("([^|:]$sess_id::)", $string); > > Anyone can help me with this? > > Thanks in advance, > > Leon Mergen > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > >

« previous php.general (#74060) next »