[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: I need help with a regular expression
From: |
Cecil Westerhof |
Subject: |
Re: I need help with a regular expression |
Date: |
Tue, 04 May 2010 15:44:56 -0000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) |
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