all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: kai.grossjohann@uni-duisburg.de (Kai Großjohann)
Subject: Re: Finding C style comments using isearch-forward-regexp
Date: Wed, 19 Feb 2003 20:01:58 +0100	[thread overview]
Message-ID: <84smukjdqx.fsf@lucy.is.informatik.uni-duisburg.de> (raw)
In-Reply-To: ubs18mlr3.fsf@superonline.com

Timur Aydin <timuraydin@superonline.com> writes:

> I am struggling to find C style comments using the
> isearch-forward-regexp function (C-M-s). Here is the regexp that I am
> using:
>
> /\*\(.\|^J\)*\*/
>
> Basically, I am telling emacs to first find the opening comment "/*",
> then any number of any character or newline and then the closing
> comment "*/".
>
> However, immediately after typing the * after the closing parenthesis,
> emacs tells me:
>
> [(error stack overflow in regexp matcher)]

I created a buffer foo.c and entered the following:

int main(int argc, char** argv)
{
    /* A comment for testing. */
    printf("hello, world\n");
}

Then I went to the beginning of the buffer, entered C-M-s, the regexp
you cited, and it found the comment just nicely.

(Note that your regexp will find too much: if there are two comments,
then it will find everything from the start of the first to the end
of the second comment.)
-- 
A turnip curses Elvis

  parent reply	other threads:[~2003-02-19 19:01 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-19 13:40 Finding C style comments using isearch-forward-regexp Timur Aydin
2003-02-19 14:15 ` Kai Großjohann
2003-02-19 17:03   ` Timur Aydin
2003-02-19 19:46     ` Stefan Monnier <foo@acm.com>
2003-02-20  7:19       ` Kai Großjohann
2003-02-20 20:35         ` Stefan Monnier <foo@acm.com>
2003-02-20 21:25           ` Kai Großjohann
2003-02-20 23:52             ` Stefan Monnier <foo@acm.com>
2003-02-21 14:00             ` Kevin Dziulko
2003-02-19 19:01 ` Kai Großjohann [this message]
2003-02-19 19:49   ` Stefan Monnier <foo@acm.com>
     [not found] <mailman.2229.1045836305.21513.help-gnu-emacs@gnu.org>
2003-02-21 14:42 ` Stefan Monnier <foo@acm.com>
2003-02-24 18:48   ` Kevin Dziulko

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=84smukjdqx.fsf@lucy.is.informatik.uni-duisburg.de \
    --to=kai.grossjohann@uni-duisburg.de \
    /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.