1
0
Fork 0

Match €-symbol

This commit is contained in:
John Ahlroos 2021-04-19 20:20:30 +03:00
parent 4b3a8e6e45
commit 5735323619
Signed by: john
GPG Key ID: 258D0F70DB84CD5D
3 changed files with 5 additions and 5 deletions

View File

@ -5,4 +5,4 @@ This project contains different PDF parsers for my personal use. Feel free to co
### Caruna Invoice Parser
PDF parser to parse Caruna invoices.
Usage: ``./gradlew :caruna-invoice:run /path/to/pdf``
Usage: ``./gradlew :caruna-invoice:run --args="/path/to/pdf"``

View File

@ -25,10 +25,10 @@ import java.util.regex.Pattern;
public class Parser {
private static final Pattern DATE_RANGE_PATTERN = Pattern.compile("(\\d\\d?\\.\\d\\d?\\.\\d\\d\\d\\d) - (\\d\\d?\\.\\d\\d?\\.\\d\\d\\d\\d)");
private static final Pattern PERUSMAKSU_PATTERN = Pattern.compile("Perusmaksu.* (\\d*,\\d\\d) EUR");
private static final Pattern P_SIIRTO_PATTERN = Pattern.compile("Päiväsiirto.* (\\d*,\\d\\d) snt.* (\\d*,\\d\\d) EUR");
private static final Pattern O_SIIRTO_PATTERN = Pattern.compile("Yösiirto.* (\\d*,\\d\\d) snt.* (\\d*,\\d\\d) EUR");
private static final Pattern TAX_PATTERN = Pattern.compile("Sähkövero.* (\\d*,\\d\\d) EUR");
private static final Pattern PERUSMAKSU_PATTERN = Pattern.compile("Perusmaksu.* (\\d*,\\d\\d) (EUR|€)");
private static final Pattern P_SIIRTO_PATTERN = Pattern.compile("Päiväsiirto.* (\\d*,\\d\\d) snt.* (\\d*,\\d\\d) (EUR|€)");
private static final Pattern O_SIIRTO_PATTERN = Pattern.compile("Yösiirto.* (\\d*,\\d\\d) snt.* (\\d*,\\d\\d) (EUR|€)");
private static final Pattern TAX_PATTERN = Pattern.compile("Sähkövero.* (\\d*,\\d\\d) (EUR|€)");
private static final Locale FI_LOCALE = new Locale("FI", "fi");
private static final DateTimeFormatter FI_DATE = DateTimeFormatter