Regular expression with numbers

B

Beffmans

Hi

I want to make a regularexpressionvalidator for a textbox to allow only
numbers but not a specified number of digits

How to do this?

ch B
 
G

Guest

Please chcek ASPNET account permission on application_start in your global
asax file.
FileIOPermission MyPermission = new
FileIOPermission(FileIOPermissionAccess.Write,
HttpContext.Current.Request.PhysicalApplicationPath);
try {
MyPermission.Demand();
}
catch(Exception ex) {
// You can tell your client that ASPNET Account does not have rights to the
filesystem.
// or redirect error page now.
}
 
H

Hans Kesting

Beffmans said:
Hi

I want to make a regularexpressionvalidator for a textbox to allow
only numbers but not a specified number of digits

How to do this?

ch B

^( [0-9]{,5} | [0-9]{7,} )$

zero to 5 numbers, or 7 or more numbers
(note: remove the spaces, they were added for readability)

Hans Kesting
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top