I made the user possible to change file names through a textarea, but now I'm having a regex problem.
As I see for Windows 7, these characters only are not allowed for filenames:
\ / : * ? < > |
But I stubbornly, perhaps also wisely, choose to minimize the regex to ONLY these special characters:
- _ .
All the others should have to be cut.
Can someone help me out with this regex?
preg_replace all but:
A-Za-z0-9 and - _ .
I still really don't get the hang of it.
str_replace();to replace the unneded characters with an empty string like this''[^A-Za-z0-9\-_.]. "anything that ISN'T one of the following..."