[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:12:45 +0800 |
User-agent: |
Gnus/5.130012 (Ma Gnus v0.12) Emacs/24.4.50 (gnu/linux) |
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"
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
Re: Regexps and strings once again, Lars Magne Ingebrigtsen, 2014/09/15
Re: Regexps and strings once again, Yuri Khan, 2014/09/14