Ask a Question related to ASP.NET General, Design and Development.
-
Brian Vallelunga #1
Re: howto use c# regular expression validator to exclude file types
I'm not great at regular expressions, but something like this should work:
(.*\.jpg)|(.*\.jpeg)|(.*\.png)|(.*\.gif)
That should do the trick. If you just want jpg files, try:
(.*\.jpg)|(.*\.jpeg)
Each section within ( ) means, any number of characters, followed by a . and
then the extension.
Brian
"Arjen" <boah123@hotmail.com> wrote in message
news:bgbf5g$8o1$1@news4.tilbu1.nb.home.nl...> Hello,
>
> Can you use the ASP.NET C# Regular Expression Validator to make sure
> that a user can only upload filenames with extension *.jpg?
>
> If so, how?
> Because I don't know how the expression should look like.
>
> Greetings en thanx in advance!
>
>
Brian Vallelunga Guest
-
Regular expression bug?
All of CF's RE functions act in a weird way, contrary to the documentation (both CF's own, and the underlying Java Regex docs). The special... -
extend Regular expression validator control
Hi all, I would like to extend Regular expression validator control to read from a config file, the custom expressions to validate. basically... -
help on regular expression
Hi, I need some help on regular expression... i have following in variable $total_count $total_count = "##I USBP 000001 10:38:09(000)... -
regular expression help..
On Thu, 28 Aug 2003 15:50:49 +0200 "point" <point@caanNOSPAMproduction.com> wrote: Don't cross post, it's considered bad form. /^-+$/ ... -
[PHP] REGULAR EXPRESSION HELP
John wrote: Your "newline" may be \r\n or \r instead of just \n. -- ---John Holmes... Amazon Wishlist:... -
Arjen #2
Re: howto use c# regular expression validator to exclude file types
Hmm, the extension is now case sensitive.
Which means that JPG is not working.
I can do this:
(.*\.jpg)|(.*\.JPG)
But is there also a way to check the upper-case on the same moment... I mean
is there a special character for that?
Thanks!
"Brian Vallelunga" <bgvallelunga@starpower.net> schreef in bericht
news:eLuKYN6VDHA.2100@TK2MSFTNGP11.phx.gbl...and> I'm not great at regular expressions, but something like this should work:
>
> (.*\.jpg)|(.*\.jpeg)|(.*\.png)|(.*\.gif)
>
> That should do the trick. If you just want jpg files, try:
> (.*\.jpg)|(.*\.jpeg)
>
> Each section within ( ) means, any number of characters, followed by a .> then the extension.
>
> Brian
>
>
> "Arjen" <boah123@hotmail.com> wrote in message
> news:bgbf5g$8o1$1@news4.tilbu1.nb.home.nl...>> > Hello,
> >
> > Can you use the ASP.NET C# Regular Expression Validator to make sure
> > that a user can only upload filenames with extension *.jpg?
> >
> > If so, how?
> > Because I don't know how the expression should look like.
> >
> > Greetings en thanx in advance!
> >
> >
>
Arjen Guest
-
Brian Vallelunga #3
Re: howto use c# regular expression validator to exclude file types
Hmm... theoretically there is, but I can't get it to work. Read here (if you
have msdn installed):
help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/cpgenref/html/cpconregularexpres
sionoptions.htm
It talks about putting in an option inline, but it wouldn't work for me.
Also, you should probably change all of those "*" to "+" in my previous
example.
Brian
"Arjen" <boah123@hotmail.com> wrote in message
news:bgc2i8$d8l$1@news2.tilbu1.nb.home.nl...mean> Hmm, the extension is now case sensitive.
> Which means that JPG is not working.
>
> I can do this:
> (.*\.jpg)|(.*\.JPG)
>
> But is there also a way to check the upper-case on the same moment... Iwork:> is there a special character for that?
>
> Thanks!
>
>
>
> "Brian Vallelunga" <bgvallelunga@starpower.net> schreef in bericht
> news:eLuKYN6VDHA.2100@TK2MSFTNGP11.phx.gbl...> > I'm not great at regular expressions, but something like this should> and> >
> > (.*\.jpg)|(.*\.jpeg)|(.*\.png)|(.*\.gif)
> >
> > That should do the trick. If you just want jpg files, try:
> > (.*\.jpg)|(.*\.jpeg)
> >
> > Each section within ( ) means, any number of characters, followed by a .>> > then the extension.
> >
> > Brian
> >
> >
> > "Arjen" <boah123@hotmail.com> wrote in message
> > news:bgbf5g$8o1$1@news4.tilbu1.nb.home.nl...> >> > > Hello,
> > >
> > > Can you use the ASP.NET C# Regular Expression Validator to make sure
> > > that a user can only upload filenames with extension *.jpg?
> > >
> > > If so, how?
> > > Because I don't know how the expression should look like.
> > >
> > > Greetings en thanx in advance!
> > >
> > >
> >
>
Brian Vallelunga Guest



Reply With Quote

