Jump to content


Photo

REGEXP's need help writing one


  • Please log in to reply
1 reply to this topic

#1 philo23

philo23
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 03 May 2006 - 07:17 PM

i need to:
check my users registering username
also
check to see if this string, '../' is found

any ideas. i'd like my usernames to contain only "_A-Z a-z 0-1" only
thanks in advance

#2 Kris

Kris
  • Staff Alumni
  • Advanced Member
  • 2,755 posts
  • LocationThe Internet

Posted 07 May 2006 - 11:08 PM

This should work
if(!eregi("[a-z0-1_]",$username)) echo "Invalid";
[a href=\"http://www.regularexpressions.info/\" target=\"_blank\"]Click here for a good regular expressions information source.[/a]




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users