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

Is ASP Validator Regex Engine Same As VS2003 Find Regex Engine?

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

Please note that this is not a request for help in forming a regex. It is
about the possibility of there being two different regex engines. The VS2003
regex commands are documented. If they are different then where are the
ASP.NET regex validator commands documented?

Apologies for repost.

Nov 19 '05 #1
2 1481
Jeb,

I know that when I use regular expressions in VS 2003 they sometimes have to
be wrapped in a caret and dollar sign.

^[regular expression here]$

Try placing those characters at the beginning and end of your regular
expression and see if it works then. Unfortunately, I can't remember which
bit of documentation I read that in. But I've been doing it for quite a
while now.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"JebBushell" <jebbushell AT yahoo DOT com> wrote in message
news:B7**********************************@microsof t.com...
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 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?

Please note that this is not a request for help in forming a regex. It is
about the possibility of there being two different regex engines. The
VS2003
regex commands are documented. If they are different then where are the
ASP.NET regex validator commands documented?

Apologies for repost.

Nov 19 '05 #2
The expression you suggest is :

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

I tested this expression in the ASP validator and it worked - just as it
had previously without the ^ and $. No problem there.

However, in VS2003 it did not work.

Just as a crosscheck I reran the abbreviated equivalent ^:n$ in VS against
the previously given dataset and it worked. When I reran it in the validator
it failed.

Either I'm goofing something up or these engines are different.
"S. Justin Gengo" wrote:
Jeb,

I know that when I use regular expressions in VS 2003 they sometimes have to
be wrapped in a caret and dollar sign.

^[regular expression here]$

Try placing those characters at the beginning and end of your regular
expression and see if it works then. Unfortunately, I can't remember which
bit of documentation I read that in. But I've been doing it for quite a
while now.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"JebBushell" <jebbushell AT yahoo DOT com> wrote in message
news:B7**********************************@microsof t.com...
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 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?

Please note that this is not a request for help in forming a regex. It is
about the possibility of there being two different regex engines. The
VS2003
regex commands are documented. If they are different then where are the
ASP.NET regex validator commands documented?

Apologies for repost.


Nov 19 '05 #3

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

Similar topics

195
by: Torbjørn Pettersen | last post by:
As you might have noticed I'm trying to clean up my web site's HTML code. The way I do it is simply more or less redoing to complete site, testing it on a web server I have set up on my local...
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...
4
by: Demetri | last post by:
Lets pretend you have a string array and each element is a sentence. Two of those elements read as follows: 1. The fox escaped from the hound. 2. The fox almost escaped. Now lets say you loop...
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 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...
10
by: Barry L. Camp | last post by:
Hi all... hope someone can help out. Not a unique situation, but my search for a solution has not yielded what I need yet. I'm trying to come up with a regular expression for a...
5
by: hamsterchaos | last post by:
<asp:RegularExpressionValidator id="valRegEx" runat="server" ControlToValidate="textbox1" ValidationExpression=" " ErrorMessage="* Please only enter alphanumeric values and make sure...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.