Tried solving today's #adventofcode using only regex, and it turns out that it's not easy to match a string containing any character consecutively repeated exactly 2 times (but no more).

For example, I want to match "abccd", but not "abcccd".

Hint if you want it 

@ihabunek remember that they are sorted, so all duplicates are next to each other. Perhaps if you just count the numbers and look for any with a count of 2

Hint if you want it 

@Absinthe I already solved it that way, just wanted to do it using regexes too.

Follow

Hint if you want it 

@ihabunek that just needs curlies

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.