keiusui has asked for the wisdom of the Perl Monks concerning the following question:
if($input =~ /badword/i){exit 1;}
This works for most users, but some clever users have bypassed the conditional by submitting strings such as "bad.word", "b.a.d.w.o.r.d", "b/a/d/w/o/r/d" and "b a.d*w/o r-d".
So, my question is:
How can I modify my conditional statement so that if a user enters the string "badword" with ANY non-alphanumeric characters in between each letter, then the program quits?
Thank you so much.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: prohibiting certain strings
by phaylon (Curate) on Dec 28, 2005 at 23:29 UTC | |
|
Re: prohibiting certain strings
by atcroft (Abbot) on Dec 29, 2005 at 00:48 UTC | |
by keiusui (Monk) on Dec 29, 2005 at 04:15 UTC | |
|
Re: prohibiting certain strings
by dimar (Curate) on Dec 29, 2005 at 00:01 UTC | |
by Anomynous Monk (Scribe) on Dec 29, 2005 at 04:48 UTC | |
|
Re: prohibiting certain strings
by diotalevi (Canon) on Dec 28, 2005 at 23:18 UTC | |
by ikegami (Patriarch) on Dec 29, 2005 at 02:12 UTC | |
by diotalevi (Canon) on Dec 29, 2005 at 03:36 UTC | |
|
Re: prohibiting certain strings
by bart (Canon) on Dec 28, 2005 at 23:31 UTC | |
by ptum (Priest) on Dec 28, 2005 at 23:39 UTC | |
|
Re: prohibiting certain strings
by TedPride (Priest) on Dec 29, 2005 at 03:18 UTC |