regular expression to restrict changes by Item Name
I have a problem with a regular expression to not allow special characters in file names.
I used the following expression ^[_0-9a-zA-Z\.]+$ which allows alphabetical characters, numbers, '_' and '.'. I don't allow '-' in files names.
The result is that It doens't allow the creation of a file named xx&yy or xx-yy.
It also doesn't allow to rename a file xx&yy but renaming a file xx-yy works.
And I don't understand why :-( the character '-' is accepted when it is a rename operation.
Thanks for your help.
Samira
I used the following expression ^[_0-9a-zA-Z\.]+$ which allows alphabetical characters, numbers, '_' and '.'. I don't allow '-' in files names.
The result is that It doens't allow the creation of a file named xx&yy or xx-yy.
It also doesn't allow to rename a file xx&yy but renaming a file xx-yy works.
And I don't understand why :-( the character '-' is accepted when it is a rename operation.
Thanks for your help.
Samira