pattern match for a folder
Posted: Tue Jul 05, 2005 1:54 pm
I am lookin for a regular expression I can use for folder names.
Users enter a folder name into a form, this name then needs to be validated. I dont seem to be able to get this to work:
The only characters I want to allow are - and _ but I dont mind how many anyone uses.
Thx andy
Users enter a folder name into a form, this name then needs to be validated. I dont seem to be able to get this to work:
Code: Select all
$pattern = "[[]]_-+";
if(!ereg($pattern, $new_cat)){
print("The category chosen has some invalid characters in the name please retype it without \"';:\/><+=)(*&^%\$£!¬.\" ");
$i++;
}Thx andy