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. 2 1493
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******** *************** ***********@mic rosoft.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.
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******** *************** ***********@mic rosoft.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. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 network.
I have downloaded, and installed CSE HTML Validator Pro,
but I don't get the same results with that as I do with the online
validator on W3.org. And I can't upload files to W3.org either,
due to all the ASP code I use.
|
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.
|
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 the string array and inside that
loop you use a Regex class to determine if the current
element matches a certain criteria. The criteria being as
follows:
|
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:
|
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";
| |
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 always work in ASP.NET and vice
versa. For example:
+({0,1})(*)
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...
|
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
RegularExpressionValidator that will allow certain HTML tags:
<a>, <b>, <blockquote>, <br>, <i>, <img>, <li>, <ol>, <p>, <quote>,
<ul>
|
by: hamsterchaos |
last post by:
<asp:RegularExpressionValidator id="valRegEx" runat="server"
ControlToValidate="textbox1"
ValidationExpression=" "
ErrorMessage="* Please only enter alphanumeric values and make sure
you are not entering in any apostrophes."
display="dynamic">*
I need
|
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
|
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...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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...
|
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...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |