From: Cecil Westerhof <Cecil@decebal.nl>
To: help-gnu-emacs@gnu.org
Subject: Re: I need help with a regular expression
Date: Sat, 17 Apr 2010 08:20:40 +0200 [thread overview]
Message-ID: <87hbnawqfb.fsf@linux-lqcw.site> (raw)
In-Reply-To: 83ceaced-77d2-4c96-a750-e328b74a33b8@u31g2000yqb.googlegroups.com
José A. Romero L. <escherdragon@gmail.com> writes:
>> thinking about something like:
>> "^[^;]+(defun "
>>
>> But that does not work. It marks the following completely, instead of
>> the three at its own:
>> (defun a () (message "a"))
>> (defun b () (message "b"))
>> (defun c () (message "c"))
>>
>> Why is this? And how can I make a regular expression that does what I
>> want?
>
> Because emacs regular expressions are by default multi-line? All in
> all an emacs buffer is just a very long stream of characters, so this
> approach makes sense, I guess.
>
> Try this instead: "^[^;\n]*(defun " - and remember: regexp-builder is
> your friend ;-)
I thought I tried that, but properly not, otherwise I should not have
asked this question. Thanks.
--
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
next prev parent reply other threads:[~2010-04-17 6:20 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-16 21:25 I need help with a regular expression Cecil Westerhof
2010-04-16 22:16 ` José A. Romero L.
2010-04-17 6:20 ` Cecil Westerhof [this message]
2010-05-04 21:21 ` Lennart Borgman
2010-05-05 15:51 ` J. David Boyd
[not found] ` <mailman.7.1273074686.2155.help-gnu-emacs@gnu.org>
2010-05-06 10:17 ` Xah Lee
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=87hbnawqfb.fsf@linux-lqcw.site \
--to=cecil@decebal.nl \
--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).