c# - Regex string does not contain dot -
i need write following regex (c#) - input string not contain dot (.) character. how can it?
p.s. have access regex. cannot use "string.contains" method (api of third-party application). that's why asked how regex
thanks in advance
you use below regex don't allow dot character,
^[^.]+$ example:
string s = "0787654321"; if (regex.ismatch(s, @"^[^.]+$")) { console.writeline("correct format"); } else { console.writeline("error! wrong format."); }
Comments
Post a Comment