-1
"(?<=(.))(?!\\1)"

Can someone help me break this down?

I understand that ?<= is looking at all the characters following (.) basically any character, but then i get lost on the (?!\1) part.

Im very new to regex and while this has helped solve my problem i really want to understand whats going on here.

Thanks!

shmosel
  • 42,915
  • 5
  • 56
  • 120

1 Answers1

-1

In other words, find a position preceded by some character and not followed by the same character.

I'm guessing it's used to split a string into groups of repeating characters.

shmosel
  • 42,915
  • 5
  • 56
  • 120