Variable: sh-assignment-regexp

sh-assignment-regexp is a customizable variable defined in sh-script.el.gz.

Value

((csh . "\\<\\([[:alnum:]_]+\\)\\(\\[.+\\]\\)?[      ]*[-+*/%^]?=")
 (ksh88 . "\\<\\([[:alnum:]_]+\\)\\(\\[.+\\]\\)?[    ]*\\(?:[-+*/%&|~^]\\|<<\\|>>\\)?=")
 (bash . "\\<\\([[:alnum:]_]+\\)\\(\\[.+\\]\\)?\\+?=")
 (rc . "\\<\\([[:alnum:]_*]+\\)[     ]*=")
 (sh . "\\<\\([[:alnum:]_]+\\)="))

Documentation

Regexp for the variable name and what may follow in an assignment.

First grouping matches the variable name. This is upto and including the = sign. See sh-feature.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/sh-script.el.gz
(defcustom sh-assignment-regexp
  ;; The "\\[.+\\]" matches the "[index]" in "arrayvar[index]=value".
  `((csh . "\\<\\([[:alnum:]_]+\\)\\(\\[.+\\]\\)?[ \t]*[-+*/%^]?=")
    ;; actually spaces are only supported in let/(( ... ))
    (ksh88 . ,(concat "\\<\\([[:alnum:]_]+\\)\\(\\[.+\\]\\)?"
                      "[ \t]*\\(?:[-+*/%&|~^]\\|<<\\|>>\\)?="))
    (bash . "\\<\\([[:alnum:]_]+\\)\\(\\[.+\\]\\)?\\+?=")
    (rc . "\\<\\([[:alnum:]_*]+\\)[ \t]*=")
    (sh . "\\<\\([[:alnum:]_]+\\)="))
  "Regexp for the variable name and what may follow in an assignment.
First grouping matches the variable name.  This is upto and including the `='
sign.  See `sh-feature'."
  :type '(repeat (cons (symbol :tag "Shell")
		       (choice regexp
			       (sexp :format "Evaluate: %v"))))
  :group 'sh-script)