Is Validator Regex Same as VS 2003?

G

Guest

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?
 
P

Patrick.O.Ige

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
 
G

Guest

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 said:
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 said:
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?
 

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

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top