Regular Expression Validator

Discussion in 'ASP .Net' started by Ben Crinion, Mar 1, 2006.

  1. Ben Crinion

    Ben Crinion Guest

    Hi

    I have a page with a html <input type="file"> element on it and i am using a
    regular expression validator to ensure that the user is uploading an image
    to my server.

    Here is my regular expression
    /^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w].*))+(.gif|.GIF|.jpg|.JPG|.jpeg|.JPEG|.bmp|.BMP)$/

    It should match "C:\any directory\structure\you like\any image name with an
    extension from the list above.gif"

    This works in perl and correctly matches but it doesnt match in .NET.

    The funny thing is im sure this has worked in the past because i have images
    on my site which have been uploaded using it. I recently upgraded my code
    from ASP.NET 1.1 to ASP.NET 2.

    Thanks
    Ben Crinion
     
    Ben Crinion, Mar 1, 2006
    #1
    1. Advertising

  2. Ben Crinion

    the4man Guest

    Have you removed the first and last slashes?
     
    the4man, Mar 1, 2006
    #2
    1. Advertising

  3. Ben Crinion

    Ben Crinion Guest

    Yes, I have tried it with and without them.

    Thanks
    Ben

    "the4man" <> wrote in message
    news:...
    > Have you removed the first and last slashes?
    >
     
    Ben Crinion, Mar 1, 2006
    #3
  4. Ben Crinion

    Ben Crinion Guest

    Hi

    It seems that this is a bug with internet explorer 7.

    It works fine with IE6.

    Thanks
    Ben Crinion

    "Ben Crinion" <> wrote in message
    news:...
    > Yes, I have tried it with and without them.
    >
    > Thanks
    > Ben
    >
    > "the4man" <> wrote in message
    > news:...
    >> Have you removed the first and last slashes?
    >>

    >
    >
     
    Ben Crinion, Mar 1, 2006
    #4
    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. Brian Vallelunga
    Replies:
    2
    Views:
    8,295
    Brian Vallelunga
    Jul 31, 2003
  2. VSK
    Replies:
    2
    Views:
    2,305
  3. Bryce Budd

    Regular Expression Validator

    Bryce Budd, Sep 18, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    576
    Brian Davis
    Sep 18, 2003
  4. Simple Simon
    Replies:
    2
    Views:
    4,347
    Simple Simon
    Nov 4, 2003
  5. Edward
    Replies:
    0
    Views:
    830
    Edward
    Dec 4, 2003
Loading...

Share This Page