Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!us.feeder.erje.net!feeder.erje.net!eu.feeder.erje.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Mel Smith" Newsgroups: comp.lang.javascript Subject: ScreenName validation Date: Tue, 8 Jan 2013 10:44:26 -0700 Lines: 35 Message-ID: X-Trace: individual.net ef2G6AsLE8W3FGTCDAR3kgOnIU118GGCSMh88xLNjquTBY+v8y1QvyF3oTsrPyXr2x Cancel-Lock: sha1:M+SmXkWaxLWLVRalLbbfyVA9eEU= X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: csiph.com comp.lang.javascript:18020 Hi: On a new site I'm building, I require the client (U.S., or Canadian) to enter his chosen 'Screen Name'. I wish to allow >= 2 and <= 12 characters to be input. I want only lowercase alpha chars along with a dot ( . ), dash( - ), and underscore( _ ) to be allowed. But no whitespace should be allowed. At the server, I will add a 4-digit value to the chosen screenname, giving the screen name some uniquity, and return the corrected screen name to the client. If the user leaves the screenname field blank, I will create a screenname from the given and surnames (which are mandatory input fields). These names will be checked against a national Names database for verification. The final screen name will be something like: mel_s1234 // for a blank input or snow.bird1234 // where the user has entered " SNOW Bird" Will someone suggest a Regex function for this input field. Thanks, -- Mel Smith