Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Regular Expression Validator

Reply
Thread Tools

Regular Expression Validator

 
 
Ben Crinion
Guest
Posts: n/a
 
      03-01-2006
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


 
Reply With Quote
 
 
 
 
the4man
Guest
Posts: n/a
 
      03-01-2006
Have you removed the first and last slashes?

 
Reply With Quote
 
 
 
 
Ben Crinion
Guest
Posts: n/a
 
      03-01-2006
Yes, I have tried it with and without them.

Thanks
Ben

"the4man" <> wrote in message
news: oups.com...
> Have you removed the first and last slashes?
>



 
Reply With Quote
 
Ben Crinion
Guest
Posts: n/a
 
      03-01-2006
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: oups.com...
>> Have you removed the first and last slashes?
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Regular Expression Validator seems to be wrong! Edward ASP .Net 0 12-04-2003 05:31 PM
P.O. Box Regular Expression Validator - heeeeeelp? Simple Simon ASP .Net 2 11-04-2003 05:10 PM
Regular Expression Validator Bryce Budd ASP .Net 1 09-18-2003 05:51 PM
Dynamically changing the regular expression of Regular Expression validator VSK ASP .Net 2 08-24-2003 02:47 PM
Re: howto use c# regular expression validator to exclude file types Brian Vallelunga ASP .Net 2 07-31-2003 10:27 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57