diff --git a/day8/day8part1.exs b/day8/day8part1.exs index cf8c0ea..850c945 100644 --- a/day8/day8part1.exs +++ b/day8/day8part1.exs @@ -9,7 +9,7 @@ defmodule Day8Part1 do def input_to_instrs(input) do input |> String.split("\n", trim: true) - |> Enum.map(&Regex.run(~r/\A(\w{3}) ([+\-]\d+)\z/, &1, capture: :all_but_first)) + |> Enum.map(&String.split/1) |> Enum.with_index() |> Map.new(fn {[op, arg], idx} -> {idx, {op, String.to_integer(arg)}} end) end diff --git a/day8/day8part2.exs b/day8/day8part2.exs index c7cacbe..1100df3 100644 --- a/day8/day8part2.exs +++ b/day8/day8part2.exs @@ -9,7 +9,7 @@ defmodule Day8Part2 do def input_to_instrs(input) do input |> String.split("\n", trim: true) - |> Enum.map(&Regex.run(~r/\A(\w{3}) ([+\-]\d+)\z/, &1, capture: :all_but_first)) + |> Enum.map(&String.split/1) |> Enum.with_index() |> Map.new(fn {[op, arg], idx} -> {idx, {op, String.to_integer(arg)}} end) end