index > Visual C# General > Validation expression for a RegularExpressionValidator!

Validation expression for a RegularExpressionValidator!

Hi,

Can someone give me the validation expression for a RegularExpressionValidator in asp.net. i need two  validation expression.The rule for the first one is as follows.It should allow the following:

a-z or A-Z
0-9 and
underscore (_)
Also, the underscore should not be the first or the last character.

Rule for second validation expression is:

only numbers 0-9 and it should be four digits

Thanks & Regards,
Frenz

Frens

Hi,

I got the answer for the second one its \d{4}. Can someone help me with the first one.

Thanks,

Frenz

Frens
reply 2

You can use google to search for other answers

 

More Articles

• Height of controls
• Move textbox around on my form in run-time
• if..then..else
• adding fontstyles together
• setup project
• Private members ... global variable??
• how to disable the event of index_change of ComboBox
• SMS via PDA
• How to make a playlist and play it in C#?
• Componetn to create pdf
Bookmark and Share
Welcome to Bokebb   New Update  
 

New Articles

• copying files using Microsoft.VisualBasi
• Is it hard to code in Csharp if I know V
• recognizing other windows
• Challengeing question about Sockets..
• checkedlistbox
• Strange PathPointType = 163
• DataGrid multiple controls??????
• Need DataGridView to display rows chrono
• App.config: I can not read from <appl
• How to make mouse cursor disappear
• NAnt and .Net 2.0
• Where do I put Using System; !!!!
• Dynamic Query in Visual C# 2005 !!!
• Image Transfer via Remoting
• Detecting mouse clicks

Hot Articles

• Settings problems
• How to Install Windows Service using com
• C# Code not Working in Win 2000
• how to write into XML
• msmq slow preformance
• closing an application from a command line
• What is the best way to implement VB sty
• Componetn to create pdf
• How to add folders into .Net's install s
• how to handled multiple table in windows
• "CausesValidation" and "U
• How to Automatic Shutdown the PC?
• Error accesing outlook contacts
• Hibernate and Suspend
• compact framework data types with symbia

Recommend Articles

• Need parent domain of child domain for A
• How I can fill a DataTable with a DataGr
• AT Command set for Samsung X600
• Creating a hidden directory & file!
• How to restart from Standby or Hibernation
• Migration from .net to vs2005
• Sending mail with Outlook Express ?
• Strange prolem with Culture settings
• Infinite integer
• using lock statement to synchronise stat
• Speech Reco. Problem
• Background Threading Within Web Services
• Using Calendar.SelectedDate to update Gr
• which control captures drawing?
• How to assign folder access right progra