Arch4ngel Posted March 29, 2004 Posted March 29, 2004 Ok... I'm not used to RegularExpression... I got a serial number that is only composed of character and number (their position aren't regular). I want to use a RegularExpression to make sur that their is only character and number in the text box. I use a RegularExpressionControlValidator. ControlToValidate is set to a TextBox named txtNoSerial. Some help could help me! (I know I could have done it in a loop and verify character by character but I want it done by a regular expression as far as it can do it.) Quote "If someone say : "Die mortal !"... don't stay to see if he isn't." - Unknown "Learning to program is like going out with a new girl friend. There's always something that wasn't mentioned in the documentation..." - Me "A drunk girl is like an animal... it scream at everything like a cat and roll in the grass like a dog." - Me after seeing my girlfriend drunk and some of her drunk friend. C# TO VB TRANSLATOR
mocella Posted March 29, 2004 Posted March 29, 2004 \w should do the trick - matches any "Word" character, including underscore - [a-zA-Z0-9_] the "opposite" is \W which matches any "non-Word" character outside of the above list Quote
Arch4ngel Posted March 29, 2004 Author Posted March 29, 2004 You was near of what I needed. It wasn't \w but \w*. Thanks a lot dude! Quote "If someone say : "Die mortal !"... don't stay to see if he isn't." - Unknown "Learning to program is like going out with a new girl friend. There's always something that wasn't mentioned in the documentation..." - Me "A drunk girl is like an animal... it scream at everything like a cat and roll in the grass like a dog." - Me after seeing my girlfriend drunk and some of her drunk friend. C# TO VB TRANSLATOR
alt Posted April 11, 2004 Posted April 11, 2004 if you want to exclude empty strings you have to use \w+ Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.