473,769 Members | 4,173 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1168
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******** *************** ***********@mic rosoft.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******** *************** ***********@mic rosoft.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
18080
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 want to happen is the Regular Expression Validator to return false only when the string contains PO Box. Currently it is false even when a valid address exists.
8
2034
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 string (when you don't enter any values) - this is wrong d+ expression does not match, for example "g24" string - this is also wrong www.regexplib.com test validator works fine for both cases, i.e. it is reporting "not match" for the...
3
2079
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 decimal point .? and any number of digits after the decimal * the whole thing looks like this:
1
2226
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
1493
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 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,1})(*)
2
6580
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 being maximum). However, on my page, no matter the length, this validator is always coming up as invalid. Is the expression incorrect?
3
5364
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 great. When it's disabled the server side validation works for the required field, but the server side doesn't work for the regEx validator. Any ideas? Is it because two validators are tied to the same control? Thanks,
3
1390
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 built-in to the regex validator?
4
159
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
9589
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
9999
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8876
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7413
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5310
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3967
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3570
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.