Validating filenames with regularexpressionvalidator

When you're designing your application, you should always be able to count on the data being in a specific format.For example, if you need to add two numbers, you need to make sure they are indeed numbers.To see what the Regex line is doing Copy and paste the line into Debuggex: [^] Matches: file c:\c:\this\is\my\dir_personal-name\\myserver\Does not match: c:\spaces are not allowed\\my! Also like how it handles multiple dots in file name. It would be better to list similar file extensions in order from longest to shortest because of regexp "laziness". if you want \folder\something\to be valid then try the below regular expression. I like how it handles spaces in folders and file names. \folder\something alone is not valid unless you concatenate it with a file name.

This listing uses a few Web controls to display a user interface.Most likely, he'll ask you for your name again.He must either verify that your name is indeed "56" or get your real name.With computers, this kind of behavior can be disastrous.If an application is expecting one type of data, giving it another type of data may result in an error or even a crash (as you may have already experienced with your ASP. Input validation is the process of making sure that the user provides the correct type of data.

Leave a Reply