A Regular Expression to validate alphabetic characters with dots and spaces in C#

Posted by Rajnilari2015 under C# category on | Points: 40 | Views : 1015
Suppose we have a string like A.K. Ramaswamy

And we want to write the regular expression for the same. The below will do so

using System;
using System.Text.RegularExpressions;

namespace ConsoleApplication1
class Program
static void Main(string[] args)
var input = "A.K. Ramaswamy";
Regex rgx = new Regex(@"^[a-zA-Z. ]*$");

Comments or Responses

Login to post response