Subject: need regular expression
Posted By: keyvanjan Post Date: 8/30/2006 2:17:41 AM
I need a regular expression that validates only letters and numbers
note:letters normal and captalized both

Reply By: dparsons Reply Date: 8/30/2006 7:51:34 AM
\w+([-+.]\w+)*

that should work.

"The one language all programmers understand is profanity."
Reply By: keyvanjan Reply Date: 8/30/2006 8:45:22 AM
Hi,That was great dparsons.
now how can I add space to this
letters,numbers plus space allowed

Reply By: dparsons Reply Date: 8/30/2006 9:41:41 AM
\w+([\s+.]\w+|\s+)*

This will match
a
a[space]
a[space]a
a[space]a[space]
etc

"The one language all programmers understand is profanity."
Reply By: keyvanjan Reply Date: 8/31/2006 1:42:49 AM
great.
and finally
what about unicode support?if sb writes arabic or farsi or german characters he will get error.
is this also possible to allow these?

Reply By: dparsons Reply Date: 8/31/2006 7:16:55 AM
That gets to be an extensive expression and I don't have time to sit and write it, looks like your going to have to go to google to finish the pattern. Sorry.

"The one language all programmers understand is profanity."

Go to topic 49102

Return to index page 188
Return to index page 187
Return to index page 186
Return to index page 185
Return to index page 184
Return to index page 183
Return to index page 182
Return to index page 181
Return to index page 180
Return to index page 179