Ok, I think I've figured it out; I needed to put another pipe (|) after the apostrophe and add a space:
^([[:alpha:]]|-|'| )+$
I hadn't realised that those pipe characters meant 'or'.
All the best,
Jim
HI,
I am trying to find a regular expression that will validate a name entered in a form that consists of both a first name and a surname. In Larry Ullman's book he has an example for validating a first name:
eregi ("^([[:alpha:]]|-|')+$", $name)
But this doesn't work for me - I...
Thanks, that's it working now. I had been trying to insert the database name using a variable - which didnt' work; I hadn't got as far as using variables for the user and password, because I thought it wouldn't work.
Fantastic - thanks for your help.
And thanks for the include tip - I...
Hi,
I'm writing a Perl CGI script to send a newsletter to e-mail addresses stored in a MySQL database. I have my script stored in a cgi-bin directory and I have a web form that I write a message into and it POSTs the results to the cgi.
I can access the MySQL database ok using the DBI...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.