I am looking for a regular expression for c# asp.net 3.5 that will fail if there are ever any double spaces in a sentence or group of words.
the cat chased the dog = true
the cat chased the dog = false (doubles spaces occur at random intervals)
thanks
Try
^((?!\s{2}).)*$
In this expression (?!\s{2}). matches every character except whitespace ones, followed by another whitespace.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With