You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm struggling to figure out how to find all instances of mul(x, x) instructions in the text, ignoring all the garbage characters. This is something that would be easy to do with Regular Expressions; the pattern mul\((\d+),(\d+)\) would find the matches and capture the values.
I have the following parser which will match instances of the instruction:
But I can't figure out how to process the rest of the text. I guess that I need to use a OneOrMany parser, in conjunction with a parser which can churn through and discard the garbage?
The text was updated successfully, but these errors were encountered:
Consider the following piece of text, taken from one of the problems in this year's Advent of Code:
I'm struggling to figure out how to find all instances of
mul(x, x)
instructions in the text, ignoring all the garbage characters. This is something that would be easy to do with Regular Expressions; the patternmul\((\d+),(\d+)\)
would find the matches and capture the values.I have the following parser which will match instances of the instruction:
But I can't figure out how to process the rest of the text. I guess that I need to use a
OneOrMany
parser, in conjunction with a parser which can churn through and discard the garbage?The text was updated successfully, but these errors were encountered: