branch: elpa/beancount
commit 3725c027026f45431d891a13810c218dc60e723e
Author: Michael Brase <[email protected]>
Commit: Martin Blais <[email protected]>
Update account name regex to allow starting with a number
The beancount language specification states that:
Each component of the account names begin with a capital letter
or a number and are followed by letters, numbers or dash (-)
characters. All other characters are disallowed.
The existing expression only supported accounts starting with capital
letters.
---
beancount.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/beancount.el b/beancount.el
index 8c557ca1cd..50c8cd07e2 100644
--- a/beancount.el
+++ b/beancount.el
@@ -213,7 +213,7 @@ from the open directive for the relevant account."
(defconst beancount-account-regexp
(concat (regexp-opt beancount-account-categories)
- "\\(?::[[:upper:]][[:alnum:]-_]+\\)+")
+ "\\(?::[[:upper:][:digit:]][[:alnum:]-_]+\\)+")
"A regular expression to match account names.")
(defconst beancount-number-regexp
"[-+]?[0-9]+\\(?:,[0-9]\\{3\\}\\)*\\(?:\\.[0-9]*\\)?"