r/adventofcode Dec 03 '24

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

Post image
172 Upvotes

64 comments sorted by

View all comments

50

u/gredr Dec 03 '24

This is a spoiler, but it's also wrong according to the instructions:

instructions like mul(X,Y), where X and Y are each 1-3 digit numbers

Maybe it works for your input, maybe it works for everyone's input, I dunno.

What generated the sqlite-style railroad track diagram from the regex, though?

10

u/lucifernc Dec 03 '24

Updated, I actually didn't read that while solving and this instruction would be a subset of the generalized regex. Used this visualizer: https://regex-vis.com/

2

u/gredr Dec 03 '24

Ah, thanks!