all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tim X <timx@nospam.dev.null>
To: help-gnu-emacs@gnu.org
Subject: Re: does emacs support incremental searching for partial matches?
Date: Wed, 23 Feb 2011 08:49:01 +1100	[thread overview]
Message-ID: <87zkpnpwoi.fsf@rapttech.com.au> (raw)
In-Reply-To: mailman.2.1298403193.16069.help-gnu-emacs@gnu.org

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


  parent reply	other threads:[~2011-02-22 21:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-21 10:28 does emacs support incremental searching for partial matches? Leh CHAO
2011-02-22 14:21 ` Drew Adams
2011-02-22 19:33   ` Leh CHAO
2011-02-22 20:42     ` Drew Adams
     [not found]   ` <mailman.2.1298403193.16069.help-gnu-emacs@gnu.org>
2011-02-22 21:49     ` Tim X [this message]
2011-02-23 15:53     ` Stefan Monnier
2011-02-24  5:59       ` Le Wang
2011-02-24 14:43         ` Stefan Monnier
     [not found]         ` <mailman.1.1298558638.12984.help-gnu-emacs@gnu.org>
2011-02-26  3:22           ` jpkotta
     [not found] <mailman.10.1298381786.4429.help-gnu-emacs@gnu.org>
2011-02-22 21:34 ` Tim X

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zkpnpwoi.fsf@rapttech.com.au \
    --to=timx@nospam.dev.null \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.