From: "Johnstone, Colin" <[EMAIL PROTECTED]> > rather than re-invent the wheel I would prefer if you could fix this > regex I believe it covers all invalid characters one would encounter > > s/[<sup>\w\&%'[EMAIL PROTECTED](\)&_\</sup>\+,\.=\[\]]//g; > > I would then use it as a general purpose regex for validating > filenames.
Never ever "remove invalid characters". Always "remove everything except the safe characters". What if someone sends you a newline? Or a character with code 0? Or ... Your regexp makes very little sense. You definitely should go read perlretut or something. The [] denotes a character class, there is no difference whatsoever between [<sup>] and [<>ups]! Jenda ===== [EMAIL PROTECTED] === http://Jenda.Krynicky.cz ===== When it comes to wine, women and song, wizards are allowed to get drunk and croon as much as they like. -- Terry Pratchett in Sourcery -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>