Function: projectile--matches-in-file

projectile--matches-in-file is a byte-compiled function defined in projectile.el.

Signature

(projectile--matches-in-file FILE REGEXP)

Documentation

Return the first capture group of every match of REGEXP in FILE.

Matching is case-sensitive and the results keep their order, with duplicates dropped.

Source Code

;; Defined in ~/.emacs.d/elpa/projectile-20260820.1509/projectile.el
(defun projectile--matches-in-file (file regexp)
  "Return the first capture group of every match of REGEXP in FILE.
Matching is case-sensitive and the results keep their order, with
duplicates dropped."
  (let (names)
    (with-temp-buffer
      (insert-file-contents file)
      (goto-char (point-min))
      (let ((case-fold-search nil))
        (while (re-search-forward regexp nil t)
          (let ((name (match-string 1)))
            (unless (member name names)
              (push name names))))))
    (nreverse names)))