Inverting a Regular Expression in Validator

Discussion in 'ASP .Net' started by spalding, Jan 28, 2005.

  1. spalding

    spalding Guest

    One issue I've had is successfully searching for regular expression
    documentation outlining the approach to inverting the test (ie.
    returning true in the case that the expression is not found). Searching
    google using keywords such as "invert", "not equal" or even "invalid
    file extension" along with "regular expressions" do not seem to point
    to any solid explanations/examples.

    I would like to have used the regularexpressionvalidator simply for
    it's ease of use (a one liner) but, as you say, CustomValidator would
    be a suitable substitute.

    Thanks for your prompt reply.



    --
    spalding
    ------------------------------------------------------------------------
    Posted via http://www.codecomments.com
    ------------------------------------------------------------------------
    spalding, Jan 28, 2005
    #1
    1. Advertising

  2. spalding

    Peter Blum Guest

    I'm going to offer a different approach. It may seem radical at first but if
    you investigate it carefully, I think you will see how it makes sense.

    I rewrote ASP.NET validation to address its numerous limitations.
    "Professional Validation And More" (http://www.peterblum.com/vam/home.aspx)
    has 22 validators, including my version of the RegularExpressionValidator.
    All of my validators introduce the property NotCondition. When true, it
    reverses the logic. You would use it with your expression and get the
    desired results.

    I rewrote ASP.NET validation because Microsoft's design imposes some serious
    limitations and simply isn't ready to handle a lot of common requests. Users
    generally end up writing custom code and inventing hacks. I put together a
    list of limitations here: http://www.peterblum.com/vam/valmain.aspx.
    Hopefully it will help you better understand the tool you are presently
    using and why it helps to switch to another.

    --- Peter Blum
    www.PeterBlum.com
    Email:
    Creator of "Professional Validation And More" at
    http://www.peterblum.com/vam/home.aspx

    "spalding" <> wrote in message
    news:...
    >
    > One issue I've had is successfully searching for regular expression
    > documentation outlining the approach to inverting the test (ie.
    > returning true in the case that the expression is not found). Searching
    > google using keywords such as "invert", "not equal" or even "invalid
    > file extension" along with "regular expressions" do not seem to point
    > to any solid explanations/examples.
    >
    > I would like to have used the regularexpressionvalidator simply for
    > it's ease of use (a one liner) but, as you say, CustomValidator would
    > be a suitable substitute.
    >
    > Thanks for your prompt reply.
    >
    >
    >
    > --
    > spalding
    > ------------------------------------------------------------------------
    > Posted via http://www.codecomments.com
    > ------------------------------------------------------------------------
    >
    Peter Blum, Jan 28, 2005
    #2
    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. arctan
    Replies:
    6
    Views:
    1,026
    arctan
    Oct 16, 2003
  2. VSK
    Replies:
    2
    Views:
    2,289
  3. MWells
    Replies:
    1
    Views:
    645
    spalding
    Jan 28, 2005
  4. Niels Dybdahl

    inverting custom cursor

    Niels Dybdahl, Nov 21, 2005, in forum: Java
    Replies:
    0
    Views:
    399
    Niels Dybdahl
    Nov 21, 2005
  5. Harry Ohlsen

    Inverting a regular expression?

    Harry Ohlsen, Apr 29, 2005, in forum: Ruby
    Replies:
    8
    Views:
    1,097
    Assaph Mehr
    May 3, 2005
Loading...

Share This Page