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*$");
Help decoding a regular expression
4 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Kirtan PatelRank #292 · 8.6K reputationPosted Aug 24, 2009, 7:30 AM EDT
Kirtan PatelRank #292 · 8.6K reputationPosted Aug 24, 2009, 7:14 AM EDT
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 :)
Bill5 reputationPosted Aug 24, 2009, 7:26 AM EDT
Bill5 reputationPosted Aug 25, 2009, 8:13 AM EDT
Regex r = new Regex("^\\s*[a-zA-Z,\\s]+\\s*$");