Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] Re: tlug] Security question with grep/e...



> From: "Josh Glover" <tlug@example.com>
> Date: 2004/03/23 Tue PM 02:01:06 EST

> 
> Quoth Tim Hurman:
> 
> > 4) your security problems are simplified,
> >     die unless ($user_str =~ m/^[\w.]+$/);
> 
> Why the "." in the regular expression? Is that a typo? "." matches an awful
> lot, including quotes. Wouldn't a better regexp be: m/^[\w\s]+$/?

"." inside square brackets only matches itself, so Tim's regular
expression will match a string with any combination of "word"
characters and dots.

Viktor




Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links