Hi, You can do: if ($name =~ /^[a-z]+$/) { ... } and if ($password =~ /^[a-zA-Z][a-zA-Z0-9]+$/) { ... } There are perl modules that automaticly create forms with the fields you specify, that can create validating rules for usernames, emails, passwords, and those validators are done both server side and client side with a javascript code which is created automaticly with no need to know Javascript. Search for "FormBuilder" and "form" with search.cpan.org if you need that. Octavian ----- Original Message ----- From: "Lamar Upshaw" <lupshaw@xxxxxxxxxxxxxx> To: <programmingblind@xxxxxxxxxxxxx> Sent: Thursday, June 19, 2008 8:40 AM Subject: perl - example needed > From the CGI modual, I have a variable containing what will be a person's > password, which will be added to the MySQL database. How do I make sure the > variable only contains characters a-z A-Z and 0-9? I want to make sure the > password starts with a letter, it may or may not have numbers, and no > forbidden characters or symbols, including spaces. > I actually want to do something similar with the username as well, check it > to make sure only a-z and 0-9 are used with no forbidden characters, but I > want to make sure the letters in the username are all lower case. > > Thanks for any help given. > > With All Respect, > Upshaw, Lamar T > > __________ > View the list's information and change your settings at > //www.freelists.org/list/programmingblind > __________ View the list's information and change your settings at //www.freelists.org/list/programmingblind