help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: How to translate `rx' expressions to `rx-to-string'?


From: Thorsten Jolitz
Subject: Re: How to translate `rx' expressions to `rx-to-string'?
Date: Thu, 31 Jul 2014 20:33:05 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Nicolas Richard <address@hidden> writes:

> Thorsten Jolitz <address@hidden> writes:
>> Seems I did not get the syntax for function rx-to-string yet - any hints
>> would be welcome.
>
> Read the code of rx.
>
> (format "%S" (rx bol "foo_" (+ word) eol))
> => "\"^foo_[[:word:]]+$\""
>
> (format "%S" (rx-to-string '(and bol "foo_" (+ word) eol) t))
> => "\"^foo_[[:word:]]+$\""
>
> HTH,

Yes, that helps, thank you!

OTOH, just a bit more info and maybe one little example in the docstring
of `rx-to-string' would help a lot. This is supposed to be easier to use
than regular regexp syntax ...

-- 
cheers,
Thorsten




reply via email to

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