0

I'm looking for a regex that disallow all the same number, and without limitation on the length of the digits in the number.

I'm actually looking for the opposite of this regex: ^(\d)\1*$

For example:

True:
- 111118
- 1234
- 88995632

False:
- 333
- 00000
- 5555

I'm using ASP Regular Expression:

<asp:RegularExpressionValidator ID="Regex" runat="server" ValidationExpression="^(\d)\1*$" ErrorMessage="" CssClass="errfont" ControlToValidate="txtKilometer" Display="Dynamic"></asp:RegularExpressionValidator>

Thanks for the help!

  • By "number", do you by any chance mean "digit"? Because `333` doesn't fit otherwise... – SamWhan Dec 07 '17 at 13:46
  • Another Possible Duplicate: https://stackoverflow.com/questions/40153207/regex-for-all-the-digits-should-not-be-same-for-a-mobile-number – Rajesh Dec 07 '17 at 13:47
  • It's hard to tell whether the closing was relevant, depending on the (unseen) context of the question. OP, next time don't ask for just a regex, show some code. – Denys Séguret Dec 07 '17 at 13:47
  • 1
    The given questions (answers) aren't relevant, so I voted to re-open. [To do this - check this regex101 example](https://regex101.com/r/NdKWqv/1). – SamWhan Dec 07 '17 at 14:19
  • @ClasG answer was correct and I didn't find it in any of the links to the previous questions. Hoping that they would open the question so that it would have an official answer. Thank You!! – Shira Asulin Dec 07 '17 at 14:34

0 Answers0