Refine denote-retrieve regular expressions

This commit is contained in:
Protesilaos Stavrou 2022-06-16 07:11:07 +03:00
parent 1a124c2be6
commit f2cfcd26ea
No known key found for this signature in database
GPG key ID: 99BD6459CD5CA3EA

View file

@ -31,16 +31,20 @@
(require 'denote)
(defconst denote-retrieve--title-front-matter-regexp
"^\\(?:#\\+\\)?\\(?:title:\\)[\s\t]+\\(?1:.*\\)"
"^\\(?:#\\+\\)?\\(?:title\\)\\s-*[:=]\\s-*[\"']?\\(?1:.*\\b\\)[\"']?"
"Regular expression for title key and value.
The match that needs to be extracted is explicityly marked as
group 1.")
(defconst denote-retrieve--identifier-regexp
"^.?.?\\b\\(?:identifier\\|ID\\)\\s-*[:=]\\s-*\"?\\(?1:[0-9T]+\\)"
"Regular expression for filename key and value.
"^.?.?\\b\\(?:identifier\\|ID\\)\\s-*[:=]\\s-*[\"']?\\(?1:[0-9T]+\\)[\"']?"
"Regular expression for identifier key and value.
The match that needs to be extracted is explicityly marked as
group 1.")
(defconst denote-retrieve--date-front-matter-regexp
"^\\(?:#\\+\\)?\\(?:date\\)\\s-*[:=]\\s-*[\"']?\\(?1:.*\\b\\)[\"']?"
"Regular expression for date key and value.
The match that needs to be extracted is explicityly marked as
group 1.")