[Javascript] RegEx for validating a file name

Shawn Milo shawn.milo at gmail.com
Thu May 19 13:04:39 CDT 2005


Well, I'm assuming that the OP knew why he wanted it that way. He
specified alphanumeric and a three-digit extension, so that's what I
matched. I tend to be extremely annoyed when I ask a question on a
mailing list and the replies explain why it's a bad idea, rather than
how to do it.

For example, I found a post yesterday where someone had asked how to
mount a Samba share over the internet from their home machine. The
only reply was one saying that this was very unsecure and should never
be done. I think that this information is useful to the OP, but should
only be provided if the reply also contains some kind of answer to the
question. I think that people who leave those kind of replies are more
interested in appearing smarter than someone else than helping someone
else.

No offense to Paul and Hassan -- your comments were constructive to
the situation in this case. I guess I just felt like bitching about
the topic, and the opportunity arose in my 'home' mailing list.  Also,
I probably felt the need to explain why I provided a solution for what
might have been the wrong question -- to be helpful.

Shawn

On 5/19/05, Paul Novitski <paul at novitskisoftware.com> wrote:
> At 09:49 AM 5/19/2005, Hassan Schroeder wrote:
> >..just want to forget it altogether? :-)
> >
> >Using Linux/MacOS/Windows,
> >
> >  "log4j.properties" is a valid filename
> >  "Hassan_Schroeder.resume.pdf" is a valid filename
> >  "Picture of the Dogs.jpeg" is a valid filename
> >
> >..none of which would pass the proposed regex.
> 
> Quite right -- one of my brain's feet must have been standing momentarily
> in MS-DOSville.
> 
> P.
> 
> 
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
> 


-- 
Voicemail any time at:
206-666-MILO



More information about the Javascript mailing list