From: Giorgos Keramidas <keramida@ceid.upatras.gr>
To: help-gnu-emacs@gnu.org
Subject: Re: How to highlight the matching reqular expression strings
Date: Tue, 17 Mar 2009 10:55:29 +0200 [thread overview]
Message-ID: <87hc1sle9q.fsf@kobe.laptop> (raw)
In-Reply-To: mailman.3363.1237263608.31690.help-gnu-emacs@gnu.org
On Tue, 17 Mar 2009 09:59:27 +0530, Anand Dhanakshirur <asd@cdotb.ernet.in> wrote:
>>> Kindly tell me How to do regular expression seach in emacs buffer.
>>> for ex: i want to know(highlight) the all the text which are als*.
>>>
>>
>> C-u C-s a l s *
>
> Hi Bastien,
> Thanks,
> It worked for regexp like als.bd(any character).
> It highlighted the matching strings.
> But it did not work for als*bd(mutliple characters).
> It did not highlight the matching strings.
> How to do this?
The '*' character has a special meaning in reguar expressions. It means
`zero or more occurences of the last regular expression part'. So, when
you try to highlight `als*bd' it will match with `albd', `alsbd', and
`alssbd' but not with `als?bd' where '?' is any other character than 's'.
Try running `M-x highlight-regexp RET als.*bd RET' The extra '.' before
the special '*' character means `any character', so this will match text
like `alsbd', `alsabd', `alsbbd', ..., `alsaabd', `alsabbd', `alsacbd',
and so on.
next parent reply other threads:[~2009-03-17 8:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.3363.1237263608.31690.help-gnu-emacs@gnu.org>
2009-03-17 8:55 ` Giorgos Keramidas [this message]
2009-03-17 4:29 How to highlight the matching reqular expression strings Anand Dhanakshirur
2009-03-17 6:15 ` thierry.volpiatto
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87hc1sle9q.fsf@kobe.laptop \
--to=keramida@ceid.upatras.gr \
--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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).