What are you trying to do? an where is your pattern? are you trying to match
any character followed by 2 to 20 any characters  in the $string variable?

Gurhan


-----Original Message-----
From: Ilhan Guvener [mailto:[EMAIL PROTECTED]]
Sent: Sunday, April 07, 2002 11:33 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Regular Expressions


Hello

 I'm writing a code for limiting a string input and for that I'm using reg.
ex. but I have a problem:

 $string = "emramile";
  if(!(preg_match("/.{2,20}/","$string"))) {
        print "error";
  }
  else {
        print "OK";
  }

I wrote this code but it's not working. I couldn't find what the problem is.
I'll be glad if anybody help me.



See Dave Matthews Band live or win a signed guitar
http://r.lycos.com/r/bmgfly_mail_dmb/http://win.ipromotions.com/lycos_020201
/splash.asp

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


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

Reply via email to