emacs-devel
[Top][All Lists]
Advanced

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

Re: Regexps and strings once again


From: Eric Abrahamsen
Subject: Re: Regexps and strings once again
Date: Mon, 15 Sep 2014 18:22:39 +0800
User-agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/24.4.50 (gnu/linux)

Eric Abrahamsen <address@hidden> writes:

> Andreas Schwab <address@hidden> writes:
>
>> Yuri Khan <address@hidden> writes:
>>
>>> 4) Mark literal patterns: have a function that turns a string into a
>>> regex, by quoting every metacharacter.
>>
>> regexp-quote
>
> I think the idea was, instead of
>
> (regexp-quote "my (camaro|thunderbird) goes fast") ->
> "my (camaro|thunderbird) goes fast"
>
> to have
>
> (regexp "my (camaro|thunderbird) goes fast") ->
> "my \\(camaro\\|thunderbird\\) goes fast"

Hmm, I think I made a dumb mistake.

> or even better
>
> (regexp "my (camaro|thunderbird) goes fast") ->
> #mysterious-regexp-object
>
> or best of all IMHO:
>
> (rx "my (camaro|thunderbird) goes fast") ->
> #mysterious-regexp-object




reply via email to

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