Fix amount-regex to properly capture integer part.

If the integer part was 2 digits, because the integer part was
non-greedy, it only captured as much as necessary, namely one digit.
The other digit was captured by the 5th group's [:word:] not 4th because
that one is also optional.  This results in incorrect reporting of
amount length and broken aligning.

Also move the decimal dot matching from 3rd group to 4th, and quote the
dot.
This commit is contained in:
Matus Goljer 2015-09-21 21:21:31 +02:00
parent 5f2f8e50b3
commit 758a224131

View file

@ -27,8 +27,8 @@
(defconst ledger-amount-regex
(concat "\\( \\|\t\\| \t\\)[ \t]*-?"
"\\([A-Z$€£₹_(]+ *\\)?"
"\\(-?[0-9,\\.]+?\\)"
"\\(.[0-9)]+\\)?"
"\\(-?[0-9,]+\\)"
"\\(\\.[0-9)]+\\)?"
"\\( *[[:word:]€£₹_\"]+\\)?"
"\\([ \t]*[@={]@?[^\n;]+?\\)?"
"\\([ \t]+;.+?\\|[ \t]*\\)?$"))