Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning ASP.NET Databases Also see the forum ASP Databases for more general discussions of ASP database issues not directly related to these books.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET Databases section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old November 5th, 2008, 02:32 PM
Authorized User
 
Join Date: Oct 2008
Location: New York City, NY, USA.
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to alienaheart
Default expression Validator

I am using a regular exp validator to accept alphabets:

ValidationExpression="[A-Za-z]*"
But , I also want accept these special characters along with
the alphabets: ( ,), {,} ,[,].
How should I modify the above expression????

Alienaheart
__________________
Alienaheart
Reply With Quote
  #2 (permalink)  
Old November 5th, 2008, 03:36 PM
Friend of Wrox
 
Join Date: Jun 2008
Location: Snohomish, WA, USA
Posts: 1,652
Thanks: 3
Thanked 141 Times in 140 Posts
Default

Code:
    ValidationExpression="[A-Za-z\(\)\{\}\[\]]*"
Just put a backslash in front of any special character.

But I hope you realize that this expression will make the following inputs *LEGAL AND ACCEPTED*:

--------x--------
a$$$$$$$$$$$$
[**************
19111731111(8817721
%%%%%%%%X%%%%%%%%

And many more.

If you mean that you want *ONLY* the characters you have listed, then you *MUST* add the beginning-of-text and end-of-text markers, thus:
Code:
    ValidationExpression="^[A-Za-z\(\)\{\}\[\]]*$"
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Regular Expression Validator on Multi-Line TextBox wagswvu General .NET 1 June 4th, 2008 09:24 AM
Regular Expression Validator displaying a label thomaswharmanjr26 C# 0 January 25th, 2008 02:38 PM
Validator expression Maxxim ASP.NET 1.0 and 1.1 Professional 1 December 3rd, 2006 06:07 AM
Regular expression validator PT C# 4 August 25th, 2005 07:50 AM
question regarding regular expression validator NewbieProg Classic ASP Basics 1 November 9th, 2004 07:49 AM



All times are GMT -4. The time now is 05:17 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.