Solved

Regular expression validator of parenthesis on the client side

Posted on 2008-10-22
4
384 Views
Last Modified: 2012-08-14
I have a text box, where i want to add a parenthesis validator on the client side. Suppose user feeds in a value a-z or A-Z on the text box. It will prompt the user to put the value in parenthesis and if he adds parenthesis, the value is being accepted as is..Please suggest
0
Comment
Question by:Kerau
  • 2
  • 2
4 Comments
 
LVL 19

Accepted Solution

by:
Albert Van Halen earned 500 total points
ID: 22781543
Use this \([A-Za-z]+\)
0
 

Author Comment

by:Kerau
ID: 22785163
Through some research i got this..can u explain ..the functionality of the following expression if it doesn't bother you much. I am thinking of best possible scenario..

Thanks


"[0-9A-Za-z\.\*\&\(\)\-\'\/\&\,\%\s]{1,100}"
0
 

Author Closing Comment

by:Kerau
ID: 31508925
Thanks!!
0
 
LVL 19

Expert Comment

by:Albert Van Halen
ID: 22786989
In this case it will accept alpha numeric characters (0-9A-Za-z)
Any character which is escaped (with the trailing \) it also accepts white-space characters (\s).
All that with a minimum length of 1 and a maxiumum length of 100.

But according to your question, me earlier post is a good answer.

I'm not realy a regex expert though.
Perhaps it's best to post this in the Regular Expression section ??
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now