我正在尝试学习如何编写emacs主模式。网上有很多很棒的教程(例如http://www.emacswiki.org/emacs/GenericMode),但我很努力学习正则表达式匹配的语法。例如,from this answer我试图理解为什么主要模式的lisp emacs正则表达式
'(("\"\\(\\(?:.\\|\n\\)*?[^\\]\\)\""
从
(define-derived-mode rich-text-mode text-mode "Rich Text"
"text mode with string highlighting."
;;register keywords
(setq rich-text-font-lock-keywords
'(("\"\\(\\(?:.\\|\n\\)*?[^\\]\\)\"" 0 font-lock-string-face)))
(setq font-lock-defaults rich-text-font-lock-keywords)
(font-lock-mode 1))
匹配双引号之间的任何东西。此材料:http://www.gnu.org/software/emacs/manual/html_node/elisp/Regexp-Special.html#Regexp-Special 似乎没有解释。
那里有更好的资源吗?
当呈现一个节点“Regexp-Special”,它明显涵盖了一些特殊情况时,应该能够向上看“正则表达式的语法”,而不是向试图帮助的人投票。 –