help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: multiline regex mode?


From: Dieter Wilhelm
Subject: Re: multiline regex mode?
Date: Sat, 25 Nov 2006 04:01:41 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Peter Dyballa <address@hidden> writes:

> Am 24.11.2006 um 22:14 schrieb Dieter Wilhelm:
>
>> Just for completeness: where to look for the answer? In AWK, Perl, an
>> Elisp function on the Emacs wiki?
>
> Into this list – or its archive(s)! This kind of question was
> answered more than once. This year, last year, ... It might be time
> to put it into an FAQ or a Wiki. Hints are given in the Elisp info
> doc on Regexp (where the full description can be found):
>
>       `.' (Period)
>            is a special character that matches any single character
>            except a newline.
>       
>       `[^ ... ]'
>            A complemented character alternative can match a newline,
>            unless newline is mentioned as one of the characters not
>            to match.  This is in contrast to the handling of regexps
>            in programs such as `grep'.
>
> So "{[^}]*}" stands for 'a region that starts with `{´ and has no `}´
> until the final `}´ is hit; between both braces any number (starting
> with 0) of any character except `}´ can appear.'

Thanks Peter for the hassle.  Maybe I expressed myself in a confusing
manner: The period and the character alternatives I understand.  What
I really wanted to know is where to look for a possibility of
searching for *balanced* brackets like { { } } because I'll need this
in my own Elisp stuff.  It's clear that there is some code in Emacs
for it (e. g. C-M-f etc.) but I have a hunch that there might be
something else out there.  Maybe a regexp extension in Perl or ...

-- 
    Best wishes

    H. Dieter Wilhelm
    Darmstadt, Germany




reply via email to

[Prev in Thread] Current Thread [Next in Thread]