From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tim X Newsgroups: gmane.emacs.help Subject: Re: does emacs support incremental searching for partial matches? Date: Wed, 23 Feb 2011 08:49:01 +1100 Organization: Unlimited download news at news.astraweb.com Message-ID: <87zkpnpwoi.fsf@rapttech.com.au> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1298414462 20782 80.91.229.12 (22 Feb 2011 22:41:02 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 22 Feb 2011 22:41:02 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Feb 22 23:40:58 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Ps0ue-0002Nu-Kp for geh-help-gnu-emacs@m.gmane.org; Tue, 22 Feb 2011 23:40:56 +0100 Original-Received: from localhost ([127.0.0.1]:58009 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ps0ud-00064Z-UB for geh-help-gnu-emacs@m.gmane.org; Tue, 22 Feb 2011 17:40:56 -0500 Original-Path: usenet.stanford.edu!news.glorb.com!news2.glorb.com!news.glorb.com!news.astraweb.com!border5.newsrouter.astraweb.com!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:mrg8QEWYreLrv3wFzjt0nvcaAMs= Original-Lines: 44 Original-NNTP-Posting-Host: 028ff4a6.news.astraweb.com Original-X-Trace: DXC= List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:79361 Archived-At: Leh CHAO 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 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