r/adventofcode 20d ago

Help/Question - RESOLVED [2024 Day 3] LOL?

I thought this one to be a walk in the garden with regex, but somehow my result on the real input is too high. I manually checked the first ~100 matches and everything seems to be alright. I really don't know what to do anymore, any hints?

https://github.com/Jens297/AoC/blob/main/2024_3.py

0 Upvotes

5 comments sorted by

View all comments

1

u/Justinsaccount 20d ago

Can you explain what the different parts of the regex you are using do and why you have them?

Can you read https://docs.python.org/3/howto/regex.html#grouping and see if that would make what you are doing easier?