Re: Regular Expression to validate file extension

From: Chris Kennedy (chrisknospam_at_cybase.co.uk)
Date: 06/18/04


Date: Fri, 18 Jun 2004 16:25:50 +0100

Sorry about repost but my news server sometimes gets confused and appends
the question to the wrong thread. I couldn't reply because I couldn't find
it. You can sometimes find it on Google but not always. Has question not
clarified things. I want an expression to check for a variable number of
expressions in the extension of a file path e.g. jpeg or jpg or gif. I hope
this clarifies things. Regards, Chris.

"Kevin Spencer" <kspencer@takempis.com> wrote in message
news:uqerkXTVEHA.2840@TK2MSFTNGP11.phx.gbl...
> I responded to this exact same question yesterday.
>
> --
> HTH,
> Kevin Spencer
> .Net Developer
> Microsoft MVP
> Big things are made up
> of lots of little things.
>
> "Chris Kennedy" <chrisknospam@cybase.co.uk> wrote in message
> news:#gaLiDRVEHA.1048@TK2MSFTNGP09.phx.gbl...
> > Does anyone know a regular expression that will validate the file
> extension
> > but also allow multiple file extensions if necessary. It also needs to
be
> > case insensitive. Basically, what I want is to validate a file input box
> to
> > check if the extension is the correct type, i.e. .doc for a Word
Document
> > etc. Also I would like to check multiple file types, for instance allow
a
> > gif or a jpeg or a jpg.
> >
> > Regards, Chris.
> >
> >
>
>



Relevant Pages

  • Re: Regular Expression to validate file extension
    ... It tried putting this in the validation expression of my regular expression ... got it to validate a textbox with qwerty.jpg as the text value ... Regards, Chris. ... Also I would like to check multiple file types, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Smith Morra games in PGN format
    ... Chris F.A. Johnson wrote: ... When I see the extension of the file, I thought that person must be a UNIX user - then realised the site was yours. ... Do you know who first used that file extension - ICC or the the authors of the bzip2 compression routine? ...
    (rec.games.chess.analysis)
  • Input Validation of $_SESSION values
    ... A quick question as an extension to the threads about input ... It's obviously best practice to rigorously check and validate all input ... but what about $_SESSION values? ... Throughout the CMS I use a custom function to validate any ids coming ...
    (php.general)
  • Re: Regular Expression to validate file extension
    ... "Chris Kennedy" wrote in message ... > but also allow multiple file extensions if necessary. ... > check if the extension is the correct type, i.e. .doc for a Word Document ... Also I would like to check multiple file types, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Regular Expression to validate file extension
    ... In that case, Chris, it looks like boomfield has already guessed your ... > expressions in the extension of a file path e.g. jpeg or jpg or gif. ... > "Kevin Spencer" wrote in message ...
    (microsoft.public.dotnet.framework.aspnet)