[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Finding C style comments using isearch-forward-regexp
From: |
Kevin Dziulko |
Subject: |
Re: Finding C style comments using isearch-forward-regexp |
Date: |
Fri, 21 Feb 2003 09:00:09 -0500 (EST) |
On Thu, 20 Feb 2003, Kai Großjohann wrote:
> "Stefan Monnier <foo@acm.com>"
> <monnier+gnu.emacs.help/news/@flint.cs.yale.edu> writes:
>
> >> - any sequence of [^*] is allowed
> >> - a * followed by [^/] is allowed
> >> The above two can be repeated.
> >> I think that avoids backtracking.
> >
> > It will avoid matching past the comment-end, but it doesn't prevent the
> > regexp routines from pushing stuff on the stack in case we need
> > to backtrack (the routines are not clever enough).
>
> Hm. Does that mean that even, say, .* on a file with a single very
> long line will put too much stuff on the stack?
>
> Is there a way to tell the routines to never backtrack? I think
> there is a way for Perl, and Perlish things went into the Emacs
> regexp engine...
>
The regexp /*[^\(*/\)]*/ will find C comments in a non-greedy fashion.
Does this help your stack problems?
- Finding C style comments using isearch-forward-regexp, Timur Aydin, 2003/02/19
- Re: Finding C style comments using isearch-forward-regexp, Kai Großjohann, 2003/02/19
- Re: Finding C style comments using isearch-forward-regexp, Timur Aydin, 2003/02/19
- Re: Finding C style comments using isearch-forward-regexp, Stefan Monnier <address@hidden>, 2003/02/19
- Re: Finding C style comments using isearch-forward-regexp, Kai Großjohann, 2003/02/20
- Re: Finding C style comments using isearch-forward-regexp, Stefan Monnier <address@hidden>, 2003/02/20
- Re: Finding C style comments using isearch-forward-regexp, Kai Großjohann, 2003/02/20
- Re: Finding C style comments using isearch-forward-regexp, Stefan Monnier <address@hidden>, 2003/02/20
- Re: Finding C style comments using isearch-forward-regexp,
Kevin Dziulko <=
Re: Finding C style comments using isearch-forward-regexp, Kai Großjohann, 2003/02/19