in reply to Regex for weird characters
Doing it this way ensures that you only permit what you want. This is good practice, because you won't accidentally let bad stuff through. If you try to think of all the weird characters that someone can type you're *bound* to forget some of them. For example, you're probably thinking of banning é, è, ñ and ç. But had you remembered æ, œ, ß, ð, ø, å, ł and þ?if($text !~ /^[a-z0-9,]*$/i) { die "bad characters\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Regex for weird characters
by Skeeve (Parson) on Sep 27, 2004 at 15:06 UTC | |
by kutsu (Priest) on Sep 27, 2004 at 15:37 UTC | |
by DrHyde (Prior) on Sep 28, 2004 at 09:00 UTC | |
|
Re^2: Regex for weird characters
by sulfericacid (Deacon) on Sep 27, 2004 at 15:23 UTC | |
by !1 (Hermit) on Sep 27, 2004 at 15:54 UTC | |
by sulfericacid (Deacon) on Sep 27, 2004 at 16:02 UTC | |
by !1 (Hermit) on Sep 27, 2004 at 16:16 UTC | |
by sulfericacid (Deacon) on Sep 27, 2004 at 16:25 UTC |