[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: rx of (any SET...)
From: |
Harald Jörg |
Subject: |
Re: rx of (any SET...) |
Date: |
Wed, 17 Aug 2022 20:42:36 +0000 |
Michael Albinus writes:
> Hi,
>
> I have the regexp
>
> (concat "[^" (bound-and-true-p mm-7bit-chars) "]")
>
> I want to write it in rx notation, but I fail. I know how to use xr for
> reverse engineering, but I'd like to keep the variable mm-7bit-chars in
> the rx notation, and not to replace it by the literal string.
>
> How would this look like?
I found that variables can be included in rx forms with some form of
eval, or by using rx-to-string, which is a function and not a macro.
With the value of mm-7bit-chars at macro expansion time:
(rx (eval `(not (any ,mm-7bit-chars))))
With the value of mm-7bit-chars at runtime:
(eval `(rx (not (any ,mm-7bit-chars))))
(rx-to-string `(not (any ,mm-7bit-chars)))
--
Cheers,
haj