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.el24
1 files changed, 23 insertions, 1 deletions
diff --git a/lisp/ledger-regex.el b/lisp/ledger-regex.el
index bb080b94..460b50ce 100644
--- a/lisp/ledger-regex.el
+++ b/lisp/ledger-regex.el
@@ -329,7 +329,29 @@
ledger-iso-date-regexp
"\\([ *!]+\\)" ;; mark
"\\((.*)\\)?" ;; code
- "\\(.*\\)" ;; desc
+ "\\([[:word:] ]+\\)" ;; desc
"\\)"))
+(defconst ledger-xact-start-regex
+ (concat ledger-iso-date-regexp ;; subexp 1
+ " ?\\([ *!]\\)" ;; mark, subexp 5
+ " ?\\((.*)\\)?" ;; code, subexp 6
+ " ?\\([^;\n]+\\)" ;; desc, subexp 7
+ "\\(\n\\|;.*\\)" ;; comment, subexp 8
+ ))
+
+(defconst ledger-posting-regex
+ (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]")
+
+
(provide 'ledger-regex)