Posted by Alvaro G Vicario on 08/03/05 13:28
*** Chuck Anderson wrote/escribió (Tue, 02 Aug 2005 12:43:27 -0600):
> I am trying to work out the preg_match command to check windows
> filenames for illegal characters and I can not seem to get it right.
> The disallowed characters are \/:*?"<>|
>
> I can not figure out the correct syntax.
Hope this helps (not tested):
$forbidden=preg_quote('\/:*?"<>', '/');
preg_match('/[' . $forbidden . ']/', $filename);
--
-- Álvaro G. Vicario - Burgos, Spain
-- http://bits.demogracia.com - Mi sitio sobre programación web
-- Don't e-mail me your questions, post them to the group
--
[Back to original message]
|