I have a form that lets the user type what they want their filename with extension to be when downloading a file, but I need to validate on the client side (doesn’t contain [^/?*:;{}\\]+\\.[^/?*:;{}\\]+, stuff like that). The filename does not need to contain an extension, but can if they wish. I found this : Validate a file name on Windows
But I am not fluent enough in jQuery to make it work.
I have a form that lets the user type what they want their filename
Share
As my comment stated its not a jQuery issue its a javascript thing you’re after.
You can go two ways, the easiest being
The other would be using the
Regexp Object.Simply instead of using “literal regexp”, if you would agree to call it that, use the object
This handy website is primary for Ruby regexp but its a great tool of creating regexps
Rubular