2
Answers

Regular expression For Alphabetics and Space

Photo of jeevan mummadi

jeevan mummadi

14y
8.7k
1

HI everyone,
I want regular expression for allow alphabetics and space only.
Regards,
Jeevan

Answers (2)

0
Photo of jeevan mummadi
NA 157 0 14y

Hi Gomathi,
I am using below expression. But i am getting this error -->Unrecognized escape error at '\s'
Regex
objAlphaPattern = new Regex("[a-zA-Z][a-zA-Z\s]+");
return (!objAlphaPattern.IsMatch(strVal));
Regards,
Jeevan.
0
Photo of Gomathi Palaniswamy
NA 3.5k 2.2m 14y
Hi friend,

try this expression
[a-zA-Z][a-zA-Z\s]+