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."); } 

ideone


Comments

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

single sign on - Logging into Plone site with credentials passed through HTTP -

php - Why does AJAX not process login form? -