javascript - RegExp for clean file and folder names -


i'm building file manager jquery. users can create folders , upload files. need regual expression (javascript) check if entered folder-name or uploaded file-name web-save. (no special chars or spaces allowed)

the name should contain alphanumeric values (a-z,a-z,0-9), underscores (_) , dashes(-)

this seems quite straightforward:

/^[\w.-]+$/ 

useful tutorial


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -