15
gustash
8y

Well that's... an interesting way to check for three characters repeated in a row...

Comments
  • 2
  • 0
    That will make the code run = fast--;
    😃
  • 1
    The simple way:

    > /(.)\1{2}/i.test("foo")
    false
    > /(.)\1{2}/i.test("fooo")
    true
    > /(.)\1{2}/i.test("foOo")
    true
  • 5
    It's always too early in the morning for regex...
  • 3
    I always dread seeing the word "simple" and regex so close together :X
  • 2
    regex hurts me 😞
  • 2
    @boxi0 that moment, someone didn't get the joke and posts a better way...
Add Comment