summaryrefslogtreecommitdiff
path: root/lisp/ledger-regex.el
diff options
context:
space:
mode:
authorSteve Purcell <steve@sanityinc.com>2014-12-09 16:26:51 +0000
committerSteve Purcell <steve@sanityinc.com>2014-12-09 16:26:51 +0000
commit01c91130d79b8ed23443507550641ffafae1b88c (patch)
tree0366a21395565e3d439b27367979e2aee563213f /lisp/ledger-regex.el
parentb623306591cab200cc7c69fb15ea7fe2dfc81bfd (diff)
downloadfork-ledger-01c91130d79b8ed23443507550641ffafae1b88c.tar.gz
fork-ledger-01c91130d79b8ed23443507550641ffafae1b88c.tar.bz2
fork-ledger-01c91130d79b8ed23443507550641ffafae1b88c.zip
[emacs] Parse transaction leading lines more robustly
This began with noticing that the code didn't support the (ugly, yet valid) case of a tab between the date and txn description. I took the opportunity to make the regexes more consistent along the way.
Diffstat (limited to 'lisp/ledger-regex.el')
-rw-r--r--lisp/ledger-regex.el8
1 files changed, 4 insertions, 4 deletions
diff --git a/lisp/ledger-regex.el b/lisp/ledger-regex.el
index 1ff731fc..99655716 100644
--- a/lisp/ledger-regex.el
+++ b/lisp/ledger-regex.el
@@ -338,10 +338,10 @@
))
(defconst ledger-xact-after-date-regex
- (concat " ?\\([ *!]\\)" ;; mark, subexp 1
- " ?\\((.*)\\)?" ;; code, subexp 2
- " ?\\([^;\n]+\\)" ;; desc, subexp 3
- "\\(\n\\|;.*\\)" ;; comment, subexp 4
+ (concat "\\([ \t]+[*!]\\)?" ;; mark, subexp 1
+ "\\([ \t]+(.*?)\\)?" ;; code, subexp 2
+ "\\([ \t]+[^;\n]+\\)" ;; desc, subexp 3
+ "\\(;[^\n]*\\)?" ;; comment, subexp 4
))
(defconst ledger-posting-regex