Function lines

Source
pub fn lines<P>(parser: P) -> RepeatParser<RegionParser<Line, P>, EmptyParser>
Expand description

lines(pattern) matches any number of lines of text matching pattern. Each line must be terminated by a newline, '\n'.

Equivalent to line(pattern)*.

let p = parser!(lines(repeat_sep(digit, " ")));
assert_eq!(
    p.parse("1 2 3\n4 5 6\n").unwrap(),
    vec![vec![1, 2, 3], vec![4, 5, 6]],
);