473,323 Members | 1,589 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

Regular Expression Validator

5
Hi ,
I am Having a doubt in Regular expression validator,Since i am not aware of that

i am having a text box it should accept any integer value upto 8 digit and it also should accept decimal if so it should accept only two digits after the decimal point

can u guide me.
Oct 11 '07 #1
7 2961
Shashi Sadasivan
1,435 Expert 1GB
Hi,
I have been playing with regex's a bit.
But am still very crude at it.
How does this look?
[1-9][0-9]{0,7}[.][0-9]{2}
I tried it and it works

cheers
Oct 11 '07 #2
war
5
Hi,
I have been playing with regex's a bit.
But am still very crude at it.
How does this look?
[1-9][0-9]{0,7}[.][0-9]{2}
I tried it and it works

cheers

Hi,

Thanx a lot

its working but still have a doubt the thing is consider a person should enter marks some people will be getting decimals too.so my text box should accept both integers and decimals too.and if decimal occurs it should be upto 2 digits only.
Kindly note Decimal is not a compulsory One .
And my Maxlength Property of my Textbox is 8.
Oct 11 '07 #3
Shashi Sadasivan
1,435 Expert 1GB
there you go then.....
A little tutorial for you :)
Oct 11 '07 #4
war
5
there you go then.....
A little tutorial for you :)
Hi,
thanx.

but the material is littlebit confusing can u solve that to me,if u are willing.

Have a plesant day
Oct 11 '07 #5
war
5
Hi,

Consider a scenario,
People should enter amount in price textbox.
since people vary from each others ,some enter a int(eg 1245) and some may enter (eg 456.50 ) so my textbox should accept both the whole numbers and decimal numbers.

And my Textbox length is 8.

Can any one clearly guide or give the expression .bcoz i am new to validation control
If am using this [1-9][0-9]{0,7}[.][0-9]{2} its not accepting whole numbers accepting only decimal numbers so i want tht decimal symbol should be optional
Oct 11 '07 #6
kenobewan
4,871 Expert 4TB
Last time I had an optional expression I used two expressions. HTH.
Oct 11 '07 #7
Shashi Sadasivan
1,435 Expert 1GB
Last time I had an optional expression I used two expressions. HTH.
2 expressions, yea, thanks for that....I just discovered you can put in 2 expressions and either one can be matched.....
Is regex the most compact language made :P
Oct 11 '07 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Bryce Budd | last post by:
Hi all, I am trying to use a regular expression validator to check for the existence of PO Box in an address textbox. The business rule is "No addresses with PO Boxes are allowed." What I...
3
by: Mark | last post by:
To validate the length of a multiline textbox, I'm told that I have to use a regular expression validator. The regular expression below limits it to 25 characters in length, but if the user enters...
2
by: VSK | last post by:
Hi all, I have a .ascx file with dropdownbox (SSN, EmpName) textbox submit button regular expression validator( controltovalidate is the above textbox) Now i want to change the Regular...
2
by: Nazir | last post by:
Hi I'm using a regular expression validator, but if spaces are entered, it bypasses the validation! I'm using ^{5,100}$
2
by: S.Kartikeyan | last post by:
I have the following problem. I am using the follwing Regular Expression validator(REV) with validator expressions ^{1,2}$ ^{3,20}$ The idea of the first exp is 1 or 2 digits the idea of second...
2
by: Dot net work | last post by:
Hello. Say I have a .net textbox that uses a .net regularexpressionvalidator. If the regular expression fails, is it possible to launch a small client side javascript function to do something,...
5
by: John . | last post by:
I am using the Regular Expression Validator control to validate a correct email address. But, at the same time I would like to make it a required field. I tested by using just the regular...
2
by: kieran | last post by:
Hi, I am using Visual Studio 2005 and am trying to use a Regular Expression Validator control. I have a drop down list which contains various names, the first one is "Please Select". I want...
1
by: vtxr1300 | last post by:
I'm having a problem with a regular expression in conjunction with the regular expression validator. I am trying to make sure that when a user browses for a file to upload, it ends in gif, jpeg or...
2
by: Joey | last post by:
Hello guys, I'm trying to learn about regular expressions. I need to be able to use an RE that can evaluate for STRINGS (or specific sequences of characters), not just occurances of characters....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.