I would like to write a regular expression that will enforce a rule that the character string cannot contain any repeated characters in sequence.
Example:
abcd - is valid.
ababab - is valid.
abaab - is NOT valid.
I would like to apply this to both alpha characters and non-alpha characters, so:
abc11def - is NOT valid.
I would like to apply this to the following regular expression :
(from http://msdn2.microsoft.com/en-us/library/ms998267.aspx)
(?!^[0-9]*$)(?!^[a-zA-Z]*$)^([a-zA-Z0-9]{8,10})$
Do regular expressions allow me to do this, or do I need to write custom code? Can anyone show me what needs to be added to the regular expression above to enforce this rule?