[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: emacs regexp question
From: |
D . Goel |
Subject: |
Re: emacs regexp question |
Date: |
04 Jun 2003 13:19:57 -0400 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 |
untested answers below, i hope they are not all wrong :-)
> Hello:
>
> There are some regexps I don't know how to specify in gnu emacs:
>
> - How should I ask for the first occurrence of two blank lines?
"\n\n" or C-q C-j C-q C-j if invoking M-x re-search-forward
interactively. -- that command is boundto C-M-s in some modes.
>
> - How should I ask for the first occurrence of N blank lines for some fixed,
> yet large, N.
"\n\n\n\n..." I don't think there's another way to do it using emacs'
regexps. perhaps regexp is not the right approach if N is very large,
and some simple elisp is in order.
> I think emacs uses ^ for the start of the line, though I've seen
> some regexp libraries (not for emacs) that use the ^ as a sort of
> "exponentiation" symbol for the number of times a string is
> concatenated.
>
> - How can I search for regexps that have one or more newlines in the middle?
something like ".*\n.*"
DG http://gnufans.net/
--