473,382 Members | 1,357 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,382 software developers and data experts.

Is Validator Regex Same as VS 2003?

I am trying to use the VS2003 regular expression Find tool to test regular
expressions for use in a ASP.NET validator. The results I am getting are
inconsistent . What works in VS does not always work in ASP.NET and vice
versa. For example:

[0-9]+([\.]{0,1})([0-9]*)

This expression, in an ASP.NET reg exp validator identifies positive real
numbers perfectly. But, when used in the VS Find utility against a text file
of candidate values (see below) it finds none!

0.0
0
1
1.
1.0
99
99.
99.999
99.a
a
99999
-99999

I developed the above reg ex because the documented shorthand for it (:n)
does not work in ASP.NET. Am I lost? Or are these two implementations
quite different?
Nov 19 '05 #1
2 1135
What do you mean thats what works in VS doesn not work in ASP.NET?
You should be abe to find good regex resources here at:- www.regexlib.com
Hope that helps
Patrick

"JebBushell" <jebbushell AT yahoo DOT com> wrote in message
news:DB**********************************@microsof t.com...
I am trying to use the VS2003 regular expression Find tool to test regular
expressions for use in a ASP.NET validator. The results I am getting are
inconsistent . What works in VS does not always work in ASP.NET and vice
versa. For example:

[0-9]+([\.]{0,1})([0-9]*)

This expression, in an ASP.NET reg exp validator identifies positive real
numbers perfectly. But, when used in the VS Find utility against a text file of candidate values (see below) it finds none!

0.0
0
1
1.
1.0
99
99.
99.999
99.a
a
99999
-99999

I developed the above reg ex because the documented shorthand for it (:n)
does not work in ASP.NET. Am I lost? Or are these two implementations
quite different?

Nov 19 '05 #2
Create a text file in VS and add the items I gave in my original post. Then
use the "Find" utility in reg ex mode to evaluate the given regex. You
should discover that it fails to find any of the items. Contrast this with
the behavior of the same expression in a reg ex validator, where it works
fine.

The question is not a request for help on forming regular expressions. It
is about whether or not the regex engine in ASP is the same as the regex
engine in VS. Perhaps I should have made that clearer.

"Patrick.O.Ige" wrote:
What do you mean thats what works in VS doesn not work in ASP.NET?
You should be abe to find good regex resources here at:- www.regexlib.com
Hope that helps
Patrick

"JebBushell" <jebbushell AT yahoo DOT com> wrote in message
news:DB**********************************@microsof t.com...
I am trying to use the VS2003 regular expression Find tool to test regular
expressions for use in a ASP.NET validator. The results I am getting are
inconsistent . What works in VS does not always work in ASP.NET and vice
versa. For example:

[0-9]+([\.]{0,1})([0-9]*)

This expression, in an ASP.NET reg exp validator identifies positive real
numbers perfectly. But, when used in the VS Find utility against a text

file
of candidate values (see below) it finds none!

0.0
0
1
1.
1.0
99
99.
99.999
99.a
a
99999
-99999

I developed the above reg ex because the documented shorthand for it (:n)
does not work in ASP.NET. Am I lost? Or are these two implementations
quite different?


Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

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...
8
by: Dmitry Korolyov | last post by:
ASP.NET app using c# and framework version 1.1.4322.573 on a IIS 6.0 web server. A single-line asp:textbox control and regexp validator attached to it. ^\d+$ expression does match an empty...
3
by: Mad Scientist Jr | last post by:
i am trying to validate a field for a double, but not allow commas the regex specifies any number of whole number digits * no comma * an optional...
1
by: spalding | last post by:
Hi Does anyone know how to invert a regex in the regularexpressionvalidator. Example; RegularExpresionValidator val = new RegularExpressionValidator(); val.ID = "val";
2
by: JebBushell | last post by:
I see signs that the ASP.NET regular expression validator has a different instruction set that the Find utility in VS 2003. I am trying to use the VS2003 regular expression Find tool to test...
2
by: darrel | last post by:
I'm trying to validate the length of characters in a text box. Google seems to turn up a few examples of using the regex validator with this expression: ^{1, 50}$ (one being minimum length, 50...
3
by: CK | last post by:
Hello All, I have a page with a text box. It has a required field validator, and a regualur expression validator tied to it. A valid email is required. When clientside is enabled it works...
3
by: Howard | last post by:
I use a regex validator to check if a textbox is in email format. How do I make sure zero length input is not accepted? Do I need to use another requiredfield validator? or is check zero length...
4
by: win | last post by:
I am using a RegularExpressionValidator and the ValidationExpression is "/^\d{1,2}(\-|\/|\.)\d{1,2}\1\d{4}$/" It still have errorMessage. Can anyone help me? Thanks
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.