AK.ValidityChecker.CheckNamesAndConstants C# (CSharp) Method

CheckNamesAndConstants() public static method

public static CheckNamesAndConstants ( string s ) : string
s string
return string
        public static string CheckNamesAndConstants(string s)
        {
            var rege = @"(?>[_.a-zA-Z0-9]+)"; // ?> forces the regex engine to not backtrack, ?!\( ensures that the word does not end with ( which would make it a function name
            var matches = Regex.Matches(s,rege);
            if (matches.Count>0)
            {
                for (int i=0;i<matches.Count;i++)
                {
                    var m = matches[i].Value;
                    if (!IsValidNameOrConstant(m))
                    {
                        return m;
                    }
                }
            }
            return null;
        }