Web Forms :: Regular Expression For Number?
Feb 1, 2010I want regular expression for number,i want it for quantity.
it should not except only 0 .becuase 0 quantity is not possible.
but it should work for 10,100,200 etc
I want regular expression for number,i want it for quantity.
it should not except only 0 .becuase 0 quantity is not possible.
but it should work for 10,100,200 etc
I need regular expression for fax like
+(country code)-(area code)-(fax number)
for example: +1-212-9876543
and with error message,
if miss '-' then show 'missing '-'', if missing '+' then show 'missing '+''.
I want to validate a number by regular expression. Here is the requirement.
1- It should be between 1 and 200
2- maximum 2 floating point (e.g. 24.54 accepted but not 24.546)
3- the radix point can be either Dot or Comma (e.g. 29.45 - 29,45 both accepted)
4- can be intiger in this range also (e.g. 24 or 24.00)
Can anyone post an efficient regular expression for this?
I need regular expression validation for textBox Â
(integer and min value 200)
If input text 200, 201,202 Â OK
Else error input!
I am splitting the phone number entered into two parts using regular expressions below
(^d{3}) - last 7 digits
d{7} - first 3 digits
This works fine if entered value is 1234567890 or 123-456-7890
and fails if value entered is 123 456 7890 (with spaces) or 123.456.7890
how to modify above expressions to trim (spaces and .)?
I want to create Regular Expression for phone number and valid digits allowed are (,),-,+,0----9. If the left bracket ( is there,then its necessay that right bracket is also there. How to create the Regular Expression for the above. I dont know how to create the regular Expression,
View 4 RepliesI'm trying to build up some regular expressions to validate some textbox controls. I have done some research and testing but cannot get this one working. Examples of what i am trying to create regular expressions for are as follows:
Range 0-45, 0 decimal places
Range 0-20, 2 decimal places
Range 16-65, 0 decimal places
Range 0-99, 2 decimal places
Range 0-1500000, 0 decimal places
Range 0-200, 1 decimal place
For 1 and 5 respectively, I have used
([0-9]|[0-9]d|45)$
([0-9]|[0-9]d|1500000)$
The first one I am having problems for is an age range of 16-65 (inclusive), where I want no decimal places. After a post on here (Regular expression to allow numbers between -90.0 and +90.0) I thought I could use the logic and get it sussed, but can't! The expression I got to was:
(d|([1-6][6-4]))|65
I need regular expression for splitting the phone number into two parts
for example: if I pass 1234567890 or 123-456-7890
I'm using the ASP Validation control a wanted to test that multiline textbox content was between 2 and 40 characters. Any character can be provided, including the new line character. What would be the expression? What I have below fails.
[code]...
As you can read in the tittle i need a regular expression for getting any letter, symbol, number from 1 to 100 maxlength (any text posible). Can someone provide that for me and maybe a good link to understand how it works.
View 4 Repliesi have to check if an input string is valid based on the given regular expression.. this is the regular expression.
(a(bb+aaa+((ab)*bb+(aba)*aa)(a+b)*) + (b(aa+bbb+((ba)*aa+(bab)*bb)(a+b)*)
+ is an OR
* is a LOOP, it is optional, it may be done as many as a user wants.
i've tried many ways to solve the problem that my professor gave me but my knowledge isn't that enough to solve this problem..
I'm trying to use the validator to work on a email form to ensure that they enter a valid from email address. That part works. I also want to add to the expression the text that I pre-populate in the txtbox ("Enter your email address") so on postback, after sending the message, I can clear the fields and repopulate that box.
How do I add that wording to the current expression: w+([-+.']w+)*@w+([-.]w+)*.w+([-.]w+)*
I am using Regular Expression validator for a text box. The below is working fine.It is not performing validation when I enter values like 0000..001.How can I modify validation expression? But it would allow values like 100,...5000 i.e zeros after a number.
<asp:RegularExpressionValidator ID="reg2" runat="server" ControlToValidate="rng2"
ValidationExpression="^[0-9]+" ErrorMessage="*Please Enter a Valid Number for Second Range."
ForeColor="Red" Font-Bold="True"></asp:RegularExpressionValidator>
I need some help in regular expression.I am validating the textbox text when updating the records.When i click the update button,the first 5 letters should be equal to CM000 or cm000.How to validate this using regular expression in asp.net. does anyone know validationexpression for this.
View 1 RepliesIf i am giving the text
hjghj bvgfh . it is failing
I am a new to regular expressions.I need to validate an identification number so that the textbox doesn't accept numbers like 1111111, 2222222, 3333333......9999999 and 1234567, 2345678, 3456789.Could someone please post regular expression for not accepting such format.
View 4 RepliesI have a Regular Expression ^[a-zA-Z''-'s]{1,40}$ Now i want to allow DOT (.) in this expression so hows its possible to add DOT in this expression.
View 3 RepliesI have a regular expression validation set on text box. I have a grid on the same page with edit and delete buttons. In some cases I don't want the regular expression to fire. For example, I have a scenario where the text box will be disabled but I can still enter data in to the grid and modify it, but the regular expression fires when I modify the grid and the changes in the grid are not processed.how can I stop the validation when I am working on grid. I can see a property causes validation for button to stop validation but don't know how can I stop for the grid.
View 3 Repliesi want to find and replace img src path by regular expression.suppose i have the below html and from there i want to replace file path of all the src attribute of image tag.
<P>Hello</P>
<P> </P>
<P><IMG alt="C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\Sunset.jpg" src="C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\Sunset.jpg"></P>
here the file path is src="C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\Sunset.jpg"
and i want to replace it with path like src="www.mysite.com/images/a.gif" with regular expression.how can i do it with regular expression.
I am facing a problem for doing URL validation which should allow atlest two periods in the URL.If the URL does not contain atleast two periods then it should throw an error. Also the regular expression must obey all the URL validations.Please help GURUS it is urgent for me to get some solution.
View 6 RepliesI would like to validate P.O. Box with regular expression in web form text box? I don't want to allow user to enter PO Box.
eg. P. O. Box, p.o. box, PO Box, po box, etc
I want to rewrite this Url www.xyz.com/products.aspx?id=1&product=acid for this i want regular expression.
View 11 Replies how to code the following regular expression
ABC[1 digit Number b/w 1-4]1A[7 digit number 0-9]-5[5 digit character]
Eg
ABC21A0123789-5ABCYZ
I have a problem with regular expression because I want to validate a textbox and I want that mark the error text when the textbox be empty.
View 1 RepliesI am using regex for server side validations.
I am facing a problem with regex. I want to check for sepecial characters like ><*&()%$@!~+...
I need to filter these special charecters...but the problem is in my 10 textboxes there only 3 are required...
I can submit the form without entering anything...but my regex is not allowing me to submit the form without giving a space from keyboard...
I just want to check for special charecters and empty textbox without giving a spacebar...
I just check these sites(http://regexlib.com/ and http://www.regular-expressions.info/) and read some documentation on regex...its kind of confusing....
Here is my regex for Middlename: ^[a-zA-Z''-'s]|[ ]{1,40}$ its worked but its not correct....then I changed it to ^[a-zA-Z''-'sd*]{1,40}$ this also not taking emptytextbox without giving a space...
My Goal:
In most of the textboxes I need to allow only numbers and - # _ in some textboxes....
For Address: need to allow alphabets and numbers and #-_' "
City: numbers and alphabets no special chars...
Main problem is I can write regex for most of these stuff but need to all textboxes without entering anything (empty textboxes).My work got stoped due to this.