Re: [PHP-WIN] Ereg problems

2007-01-16 Thread Niel Archer
Hi As I said before I don't use posix regexes (i.e. ereg), as they're not binary safe and can be much slower than the PCRE versions. the PCRE equivalent of what you want is: if (preg_match("/^[-A-Za-z0-9_' ]+$/", $string)}: echo "string valid"; else: echo "string invalid"; endif; The "A-

Re: [PHP-WIN] Ereg problems

2007-01-16 Thread Daniel Anderson
} else { echo "string disallowed"; } Warmest Regards, Dan - Original Message - From: "Beauford" <[EMAIL PROTECTED]> To: Sent: Tuesday, January 16, 2007 5:59 PM Subject

RE: [PHP-WIN] Ereg problems

2007-01-16 Thread Beauford
o z A to Z 0 to 9 and the character _-' and spaces. So ABCDE __-' is valid, so is _-aaaBBcD' __ Thanks > -Original Message- > From: Niel Archer [mailto:Niel Archer] On Behalf Of Niel Archer > Sent: January 16, 2007 11:46 AM > To: php-windows@lists.php.net > S

Re: [PHP-WIN] Ereg problems

2007-01-16 Thread Daniel Anderson
"a-z" within one set of square brackets. Warmest Regards, Dan ----- Original Message - From: "Beauford" <[EMAIL PROTECTED]> To: Sent: Tuesday, January 16, 2007 4:20 PM Subject: RE: [PHP-WIN] Ereg problems > Nope, doesn't work for me. I think what I'm tryi

Re: [PHP-WIN] Ereg problems

2007-01-16 Thread Niel Archer
Hi What you've written doesn't match the description you gave. As a regular expression "([0-9][A-Z][a-z][-_.'\ ])" means a digit followed by an uppercase letter followed by a lower case letter followed by (hyphen or underscore or mid-dot or single quote or space). This is a total of four charact

RE: [PHP-WIN] Ereg problems

2007-01-16 Thread Beauford
ce - I have to have a space. I don't need a length. > -Original Message- > From: bedul [mailto:[EMAIL PROTECTED] > Sent: January 15, 2007 11:48 PM > To: Beauford > Subject: Re: [PHP-WIN] Ereg problems > > $nlong=strlen($username); > if(ereg ("([0-9][A-

Re: [PHP-WIN] Ereg problems

2007-01-16 Thread Niel Archer
Oops that should be "^[\w'-]+$" Niel -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-WIN] Ereg problems

2007-01-16 Thread Niel Archer
Hi > I want to allow the following: a to z, A to Z, 0 to 9, and "_-'" (without > the double quotes) and spaces. I have now been screwing around with this for > over 8 hours. There are other issues as well that has been compoudning this, > but this would be a great start to solving my issue. I don