Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 30th, 2006, 02:17 AM
Friend of Wrox
 
Join Date: May 2005
Posts: 149
Thanks: 0
Thanked 0 Times in 0 Posts
Default need regular expression

I need a regular expression that validates only letters and numbers
note:letters normal and captalized both

 
Old August 30th, 2006, 07:51 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

\w+([-+.]\w+)*

that should work.

"The one language all programmers understand is profanity."
 
Old August 30th, 2006, 08:45 AM
Friend of Wrox
 
Join Date: May 2005
Posts: 149
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,That was great dparsons.
now how can I add space to this
letters,numbers plus space allowed

 
Old August 30th, 2006, 09:41 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

\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."
 
Old August 31st, 2006, 01:42 AM
Friend of Wrox
 
Join Date: May 2005
Posts: 149
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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?

 
Old August 31st, 2006, 07:16 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

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."





Similar Threads
Thread Thread Starter Forum Replies Last Post
Regular Expression Help Please rstelma ASP.NET 1.0 and 1.1 Professional 0 January 2nd, 2008 07:01 PM
REGULAR EXPRESSION pallone Javascript How-To 0 September 5th, 2006 06:52 AM
regular expression if-then smay Javascript 4 July 5th, 2005 12:10 PM
Regular Expression Help Greg Griffiths Javascript How-To 4 November 12th, 2004 05:33 AM
Regular Expression Help Hadware .NET Web Services 3 November 4th, 2003 10:51 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.