in reply to simple regex for names or last names

I just recently spent a lot of time doing this without the lingua module. I can tell the most important thing you can do is to know your data format. If you post your data format I can help you come up with a few things probably.

  • Comment on Re: simple regex for names or last names

Replies are listed 'Best First'.
Re: simple regex for names or last names
by perleager (Pilgrim) on May 04, 2005 at 02:19 UTC
    Hello,

    I'm not sure, but is this question just asking to allow a field with aphabetical characters along with a - and . ?

    Of course like davidrw, a name can also contain a '.

    unless ( param('Company Name') =~ /^[\w.\'-]+$/) { print "Invalid characters in name. Only alphanumeric characters and + the following symbols . ' - _ are allowed."; }

    Thanks,
    perleager