Function: org-src-coderef-regexp

org-src-coderef-regexp is a byte-compiled function defined in org-src.el.gz.

Signature

(org-src-coderef-regexp FMT &optional LABEL)

Documentation

Return regexp matching a coderef format string FMT.

When optional argument LABEL is non-nil, match coderef for that label only.

Match group 1 contains the full coderef string with surrounding white spaces. Match group 2 contains the same string without any surrounding space. Match group 3 contains the label.

A coderef format regexp can only match at the end of a line.

Source Code

;; Defined in /usr/src/emacs/lisp/org/org-src.el.gz
(defun org-src-coderef-regexp (fmt &optional label)
  "Return regexp matching a coderef format string FMT.

When optional argument LABEL is non-nil, match coderef for that
label only.

Match group 1 contains the full coderef string with surrounding
white spaces.  Match group 2 contains the same string without any
surrounding space.  Match group 3 contains the label.

A coderef format regexp can only match at the end of a line."
  (format "\\([ \t]*\\(%s\\)[ \t]*\\)$"
	  (replace-regexp-in-string
	   "%s"
	   (if label (regexp-quote label) "\\([-a-zA-Z0-9_][-a-zA-Z0-9_ ]*\\)")
	   (regexp-quote fmt)
	   nil t)))