[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: count regexp hits
From: |
Emanuel Berg |
Subject: |
Re: count regexp hits |
Date: |
Thu, 04 Jan 2018 19:47:24 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) |
Re: count regexp hits
Drew Adams wrote:
> `C-h f count-matches':
>
> count-matches is an alias for `how-many' in
> `replace.el'.
OK, thanks.
(defun count-regexp-hits (regexp)
(interactive "sregexp: ")
(let*((region (if mark-active
`(,(region-beginning) ,(region-end))
`(,(point-min) ,(point-max)) ))
(start (car region))
(end (cadr region)) )
(count-matches regexp start end t) ))
> (count-matches REGEXP &optional RSTART REND
> INTERACTIVE)
>
> Print and return number of matches for REGEXP
> following point. When called from Lisp and
> INTERACTIVE
Here the docstring mentions the arguments out
of order but I suppose that truly is
"bike-shedding" even tho I don't like that
expression since everyone knows that bikes in
light, bright colors (e.g., orange, cyan, and
ocean blue) are faster than bikes with trunky,
black and brown frames...
--
underground experts united
http://user.it.uu.se/~embe8573