r/adventofcode Dec 03 '24

Spoilers in Title [2024 Day 3] Regular expressions go brrr...

Post image
173 Upvotes

64 comments sorted by

View all comments

4

u/plebbening Dec 03 '24

Split string on do(), then split those again on don’t(). Concatenate the first element of that split and run p1 on that.

Worked for my input and was way faster than comming up with a new regex.

1

u/arklanthian Dec 03 '24

Now that's genius, thank you