diff options
author | George Kettleborough <g.kettleborough@member.fsf.org> | 2013-04-13 21:56:17 +0100 |
---|---|---|
committer | George Kettleborough <g.kettleborough@member.fsf.org> | 2013-04-13 21:56:17 +0100 |
commit | 902d0f41ef610ab54786db7c859dbc86c4f6e1db (patch) | |
tree | 3603030d84db298c516d38f9c85399d7bc03bd05 | |
parent | 6396fe2bd78d63cee3caaeb45fdd4daddb68d88f (diff) | |
download | fork-ledger-902d0f41ef610ab54786db7c859dbc86c4f6e1db.tar.gz fork-ledger-902d0f41ef610ab54786db7c859dbc86c4f6e1db.tar.bz2 fork-ledger-902d0f41ef610ab54786db7c859dbc86c4f6e1db.zip |
Add regex for metadata
-rw-r--r-- | lisp/ldg-regex.el | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/lisp/ldg-regex.el b/lisp/ldg-regex.el index 8e843ae5..83bc2197 100644 --- a/lisp/ldg-regex.el +++ b/lisp/ldg-regex.el @@ -61,13 +61,22 @@ "^--.+?\\($\\|[ ]\\)") (defconst ledger-account-any-status-regex - "^[ \t]+\\([*!]\\s-*\\)?\\([^ ;].*?\\)\\( \\|$\\)") + "^[ \t]+\\(?1:[*!]\\s-*\\)?\\(?2:[^ ;].*?\\)\\( \\|\t\\|$\\)") (defconst ledger-account-pending-regex - "\\(^[ \t]+\\)\\(!\\s-*.*?\\)\\( \\|$\\)") + "\\(^[ \t]+\\)\\(!\\s-*.*?\\)\\( \\|\t\\|$\\)") (defconst ledger-account-cleared-regex - "\\(^[ \t]+\\)\\(*\\s-*.*?\\)\\( \\|$\\)") + "\\(^[ \t]+\\)\\(*\\s-*.*?\\)\\( \\|\t\\|$\\)") + +(defconst ledger-metadata-regex + "[ \t]+\\(?2:;[ \t]+.+\\)$") + +(defconst ledger-account-or-metadata-regex + (concat + ledger-account-any-status-regex + "\\|" + ledger-metadata-regex)) |