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

Discussion in 'ASP .Net' started by =?Utf-8?B?SmViQnVzaGVsbA==?=, Oct 22, 2005.

  1. 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.
     
    =?Utf-8?B?SmViQnVzaGVsbA==?=, Oct 22, 2005
    #1
    1. Advertising

  2. 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:...
    >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.
    >
     
    S. Justin Gengo, Oct 22, 2005
    #2
    1. Advertising

  3. Re: Is ASP Validator Regex Engine Same As VS2003 Find Regex Engine

    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:...
    > >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.
    > >

    >
    >
    >
     
    =?Utf-8?B?SmViQnVzaGVsbA==?=, Oct 22, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. vaidas gudas
    Replies:
    1
    Views:
    373
    Franco FigĂșn
    Jul 13, 2004
  2. =?Utf-8?B?SmViQnVzaGVsbA==?=

    Is Validator Regex Same as VS 2003?

    =?Utf-8?B?SmViQnVzaGVsbA==?=, Oct 22, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    787
    =?Utf-8?B?SmViQnVzaGVsbA==?=
    Oct 22, 2005
  3. =?Utf-8?B?Qm9i?=
    Replies:
    2
    Views:
    415
    =?Utf-8?B?Qm9i?=
    Jan 30, 2006
  4. Replies:
    4
    Views:
    947
    Richter~9.6
    Feb 13, 2007
  5. Wybo Dekker
    Replies:
    1
    Views:
    396
    Yukihiro Matsumoto
    Nov 15, 2005
Loading...

Share This Page