summaryrefslogtreecommitdiff
path: root/lisp/ledger-regex.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/ledger-regex.el')
-rw-r--r--lisp/ledger-regex.el14
1 files changed, 8 insertions, 6 deletions
diff --git a/lisp/ledger-regex.el b/lisp/ledger-regex.el
index 49a2b114..bc7e926b 100644
--- a/lisp/ledger-regex.el
+++ b/lisp/ledger-regex.el
@@ -341,12 +341,14 @@
))
(defconst ledger-posting-regex
- (concat "^[ \t]+" ;; initial white space
- "\\("
- "\\([[:word:]: ]*?\n?\\) " ;; account, subexpr 2
- "\\(.*?\\)" ;; amount, subexpr 3
- "\\(\n\\|\\(;.*\\)\\)" ;; comment, subexpr 5
- "\\)"))
+ (concat "^[ \t]+ ?" ;; initial white space
+ "\\([*!]\\)? ?" ;; state, subexpr 1
+ "\\([[:word:]: ]+\\(\n\\|[ \t][ \t]\\)\\)" ;; account, subexpr 2
+ "\\([^;\n]*\\)" ;; amount, subexpr 4
+ "\\(.*\\)" ;; comment, subexpr 5
+ ))
+
+
(defconst ledger-directive-start-regex
"[=~;#%|\\*[A-Za-z]")