I am trying to test a string (in java) for 9 adjacent identical numbers … I can test for adjacent identical numbers – but only the next adjacent number ….
boolean result = string.matches("/([0-9])\1/g");
I want to match 9 characters – anyone able to help me ?
Thanks
EDIT : Some examples
"1111111111" should match
"222222222" should match
"3311111111133" should match
"1234567890" should not match
Try this regex:
([0-9])\1{8}