plugins: lines: add support for sets of regexes to legacy syntax
If someone insists on using the old syntax for the "lines" plugin this
change will allow using multiple sets of parsing rules.
Example:
lines:
- start: Item\s+Discount\s+Price$
end: \s+Total
line: (?P<description>.+)\s+(?P<discount>\d+.\d+)\s+(?P<price>\d+\d+)
- start: Item\s+Price$
end: \s+Total
line: (?P<description>.+)\s+(?P<price>\d+\d+)
This change depends on the https://github.com/invoice-x/invoice2data/pull/407
Personally I'd rather against extending the old syntax. That one will always have some limitations and I think we should encourage people to move to the new (parser-based) YAML syntax.
It seems @bosd however prefers the old syntax (see https://github.com/invoice-x/invoice2data/pull/378 discusson) so I prepared this pull request to discuss / consider.
This was a draft to show how next rules syntax can be adapted to the old lines syntax. For now https://github.com/invoice-x/invoice2data/pull/407 got closed, so I'm closing this one too. I'm planning to get back working on rules later.