Function: css--selector-regexp

css--selector-regexp is a byte-compiled function defined in css-mode.el.gz.

Signature

(css--selector-regexp SASSY)

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/css-mode.el.gz
(defun css--selector-regexp (sassy)
  (concat
   "\\(?:"
   (if (not sassy)
       "[-_%*#.>[:alnum:]]+"
     ;; Same as for non-sassy except we do want to allow { and }
     ;; chars in selectors in the case of #{$foo}
     ;; variable interpolation!
     (concat "\\(?:[-_%*#.>&+~[:alnum:]]*" scss--hash-re
             "\\|[-_%*#.>&+~[:alnum:]]+\\)"))
   ;; Even though pseudo-elements should be prefixed by ::, a
   ;; single colon is accepted for backward compatibility.
   "\\(?:\\(:" (regexp-opt (append css-pseudo-class-ids
                                   css-pseudo-element-ids)
                           t)
   "\\|::" (regexp-opt css-pseudo-element-ids t) "\\)\\)?"
   ;; Braces after selectors.
   "\\(?:\\[[^]\n]+\\]\\)?"
   ;; Parentheses after selectors.
   "\\(?:([^)]+)\\)?"
   ;; Main bit over.  But perhaps just [target]?
   "\\|\\[[^]\n]+\\]"
   ;; :root, ::marker and the like.
   "\\|::?[[:alnum:]]+\\(?:([^)]+)\\)?"
   "\\)"))