in reply to Re^2: Site Search perlscript and security
in thread Site Search perlscript and security

IMHO, \w and \s are too liberal in what they accept. Chances are that your search will not need Unicode, and \w in particular is going to accept that if your perl has Unicode support. Unless you know you need Unicode, it's probably better to use the explicit character class [A-Za-z0-9].

"There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.

Replies are listed 'Best First'.
Re^4: Site Search perlscript and security
by steelrose (Scribe) on Nov 30, 2005 at 14:18 UTC
    A good point. Since the data I plan to search contains very few non A-Z a-z 0-9 characters that would need to be searchable, I can just add those characters to the string (like the e with acute é mark)

    If you give a man a fish he will eat for a day.
    If you teach a man to fish he will buy an ugly hat.
    If you talk about fish to a starving man, you're a consultant.