I am supporting a new application and I do not use regex very often and was hoping someone could decode the following as well as let me know if a string containing a period would pass.
Regex r = new Regex("^\\s*[a-zA-Z,\\s]+\\s*$");
Loading
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.
Kirtan PatelPosted Aug 24, 2009, 11:30 AM
BillPosted Aug 25, 2009, 12:13 PM
Regex r = new Regex("^\\s*[a-zA-Z,\\s]+\\s*$");
BillPosted Aug 24, 2009, 11:26 AM
Kirtan PatelPosted Aug 24, 2009, 11:14 AM
1 .Your Regex will First match ' \ ' Litrely
2.Then You can Write character 's' unlimited Number of Times
3. After that You can Write Any Number of Characters From A-Z or a-z or \ or ' , ' (comma) or 's'
4.Then You have to Write character 's' Unlimited number of Time
5. and Your String Should be End With ' \ ' or '\ssss'
for example your regex will Find Match of below String
"\sabcdefg\ssss\
Thats the Full decode of Your regEx .
Happy Coding :)