I am writing registration page and using validators. Here are my test case's with validator using your special characters. Both seem to not validate blank input, this may not be a regex thing.
I need a regex validator to match a special character anywhere within a word, so it will satisfy requirement which says that "ID must have at least one special character." Allowed characters are: ! / : ; @Tim Schmelter - noooo, not suing Microsoft :) The reason why I cant use this in membership provider, is because this validation will be optional - it can be turned on or off, depending on the client needs..we will not be able to enforce it for all clients of our app. There may be other constructs in classes with special syntax unique to a particular engine (.
Thank you in advance, Henrik I always greatly appreciate it when someone takes the time to write something on this subject.
NET Framework is first-class, and even just within Microsoft® ASP.
NET applications through the Regular Expression Validator control and the Regex class in the System. You can use regular expressions to restrict the range of valid characters, to strip unwanted characters, and to perform length and format checks.
You can constrain the input format by defining patterns that the input must match.
Allowed Characters Alphabet : a-z / A-Z Numbers : 0-9 Special Characters : ~ @ # $ ^ & * ( ) - _ = [ ] | \ , . : (spaces should be allowed) Not Allowed Special Characters : thanks so much, but in my case the disallowed characters are all except the allowed ones(the allowed ones are same as in question).
Could you suggest how to do that specifying the allowed ones: a-z / A-Z / 0-9 ~ @ # $ ^ & * ( ) - _ = [ ] | \ , .