`nom` is incredible. I used to iterate input by line, make up regex with capture groups, and do something ad hoc if the input isn't line by line. It gets quite ugly, if the input has multiple parts, or multiple lines as one part.<p>Now I just take the whole stdin and pass it into a parser written in `nom`. If it's line-by-line, it's a trivial: `separated_list1(tag("\n"), parse_line)`, not more difficult than iterating through lines, parsing each, and combining them. If the input isn't line-by-line, a proper parser is way more cleaner than anything I've done before.<p>And there has never been a performance problem for me. (To be fair, AOC doesn't have truly giant input size)