emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Make regexp handling more regular


From: Stefan Monnier
Subject: Re: Make regexp handling more regular
Date: Thu, 03 Dec 2020 12:40:28 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

>>     (let-re-match (overall (beg end)) (re-match "regexp")
>>       ...)
> Then we don't really need the re-match function at all...

Yes and no: we do need some place to put the information about the
OBJECT where we search, whether the search is anchored, where we START
and where we END.

> But I think this would be too somewhat cumbersome.  Like, if you want to
> write
>
> (while (setq m1 (re-search "foo"))
>   (setq m2 (re-match "[0-9]"))
>   (zot (re-string m1 0) (re-end m2 0)))

Yes, that's related to the problem with dealing with match-failure.


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]