summaryrefslogtreecommitdiff
path: root/bog.el
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2015-04-11 23:39:27 -0400
committerKyle Meyer <kyle@kyleam.com>2015-04-11 23:39:27 -0400
commit01160bfa8c6e92c7972917e71b449faa9aaf6df5 (patch)
treeb616b0b8efbcd8a0f514730f433c6b929437d695 /bog.el
parent6218b61a377e193dde9c01db59bb010e0a8b4aed (diff)
downloadbog-01160bfa8c6e92c7972917e71b449faa9aaf6df5.tar.gz
Use rx to construct bog-citekey-format
Diffstat (limited to 'bog.el')
-rw-r--r--bog.el11
1 files changed, 10 insertions, 1 deletions
diff --git a/bog.el b/bog.el
index bcbbb3a..5c4cc0d 100644
--- a/bog.el
+++ b/bog.el
@@ -44,7 +44,16 @@
:group 'org)
(defcustom bog-citekey-format
- "\\b\\([a-z]+[-a-z]*\\)\\([0-9]\\{4\\}\\)\\([a-z][a-z0-9]*\\)\\b"
+ (rx
+ word-start
+ (group
+ (one-or-more lower)
+ (zero-or-more (any lower "-")))
+ (group (= 4 digit))
+ (group
+ (one-or-more lower)
+ (zero-or-more (any lower digit)))
+ word-end)
"Regular expression used to match study citekey.
By default, this matches any sequence of lower case