AnnouncementsFunnyVideosMusicAncapsTechnologyEconomicsPrivacyGIFSCringeAnarchyFilmPicsThemesIdeas4MatrixAskMatrixHelpTop Subs
2

https://adventofcode.com/2024/day/3

I saw someone was having problems with their site before so I'm now adding the problem content to my git.

https://lab.gvid.tv/x0x7/AdventOfCodeSolutions/src/branch/main/2024/day3

From the looks of it the difficulty is going up a little.

Comment preview
[-]x0x7
0(+0|0)

Pinging last participants:

@happytoes @Aurelius @High_Quality_Dick_Pics @JasonCarswell


  • Learned: Regex (short for regular expressions) is a powerful tool for searching, matching, and manipulating strings. It is often used for tasks like pattern matching, text validation, and extracting specific parts of strings.

  • mul: Matches the literal word "mul".
  • ( and ): Matches the opening and closing parentheses ( and ).
  • \s*: Matches any amount of whitespace (spaces, tabs, etc.), including none.
  • (\d+): Captures one or more digits (numbers) in a group. The parentheses () create a capture group, so the digits can be accessed separately.
  • ,: Matches the comma between the two numbers.
  • \s* (again): Matches optional whitespace around the comma.
[-]x0x7
0(+0|0)

I tested it with the \d+ and it did return the same result but they could have thrown a curve ball with a long number. So I did \d{1,3}.

Good catch on the optional whitespace. I didn't do that but they were forgiving.

Any luck on the part 2?

oh, lol, there is a part 2? maybe not now, but i'll read the question better tomorrow! :-)

[-]Aurelius0(+0|0)

Black magic is what this is!