Validate strings with Regx in C#
I am using C# windows application of 2.0 .net Frame work. How to validate the string formats like project#, 1.project or 2.project, project:, project#1:, project#2:, project# 2 etc using regular expressions.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
MahendranathPosted Aug 27, 2009, 4:56 AM
Try with this. It will help full.....
using System.Text.RegularExpressions;
Regex myRegEx = new Regex("([0-9]+)*([^a-zA-z0-9])*[\s]*[a-zA-Z]+(#+)*[\s]*([0-9]+)*[\s]*([^a-zA-z0-9])*$");