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

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

Re: does emacs support incremental searching for partial matches?


From: Tim X
Subject: Re: does emacs support incremental searching for partial matches?
Date: Wed, 23 Feb 2011 08:49:01 +1100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Leh CHAO <lehchao@gmail.com> writes:

> Hi Drew, thank you for your help!
>
> Sometimes I would be able to know the .* part, for example, I want to
> match WindowsMemoryCacheManagement by using 'memcache'. With regular
> expression, I have to specify .*m.*e.*m.*c.*a.*c.*h.*e.*
>

You need to learn regexp. Have a look at M-x re-builder. 

To match WindowsMemoryCacheManagement you don't need
.*m.*e.*m.*c.*a.*c.*h.*e.* at all. The pattern \w*mem\w*cache\w* would
find that string. Note also that emacs isearch (C-s) is an incremental
search in the sense that if you start by typeing 'mem' it will match all
words in the buffer with mem in them, typing the next character i.e. 'o'
will match all with memo etc. Using the regexp version means you can add
regexp patterns. So, in the above case, I would type memoryc or
mem\w*cache, which would match the string you want.

Tim



>
> Thanks!
>
> eric
>
> On Tue, Feb 22, 2011 at 6:21 AM, Drew Adams <drew.adams@oracle.com> wrote:
>>> I'm wondering if emacs has built-in support for incremental searching
>>> for partial matches, such as searching for 'memcache' matches
>>> 'memorycache'. It would be really helpful to me when I'm working on
>>> Visual C++ code because the programmers tend to use long variable
>>> names.
>>
>> You can use regexp search: `C-M-s mem.*cache'.
>> See `C-h r g regexp search RET'.
>>
>>
>

-- 
tcross (at) rapttech dot com dot au


reply via email to

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