I want a regular expression that checks that a string doesn’t start with an empty space.
I want to do something like this:
Is the following ValidationExpression right for it?
string ValidationExpression = @"/^[^ ]/";
if (!String.IsNullOrEmpty(GroupName) && !Regex.IsMatch(GroupName, ValidationExpression))
{
}
How about
"^\S"This will make sure that the first character is not a whitespace character.