Function: combobulate-string-count

combobulate-string-count is a natively compiled function defined in combobulate-misc.el.

Signature

(combobulate-string-count REGEXP STRING)

Documentation

Count the number of REGEXP in STRING.

No effort is made to account for, or exclude, overlaps.

Source Code

;; Defined in /nix/store/b5fvrwzi3zvkabyzx0in6gw1cj963z46-emacs-packages-deps/share/emacs/site-lisp/combobulate-misc.el
(defun combobulate-string-count (regexp string)
  "Count the number of REGEXP in STRING.

No effort is made to account for, or exclude, overlaps."
  (let ((ct 0) (offset 0))
    (while (setq offset (string-match regexp string offset))
      (cl-incf ct)
      (cl-incf offset))
    ct))