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

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

Re: regexp that matches newline characters?


From: Dmitri Minaev
Subject: Re: regexp that matches newline characters?
Date: Sun, 11 May 2008 22:45:39 +0500

On Sat, May 10, 2008 at 3:56 AM, harven <harven@free.fr> wrote:
>  "\\(.\\|\n\\)"   matches everything.

Thanks to everyone. Parenthesized alternative works, but I found a
solution based on character classes:

\\(<author>[[:print:][:space]]*?</author>\\)

So long, it works. It will help me to get rid of nested groups.

> (search-forward-regexp "<pre class=\"mma\">\\([^•]*\\)</pre>")

Yes, but this is the same hack I wanted to avoid: taking a character
which is not supposed to be found inside the tag and matching anything
except for this character. What if this character appears in some
author's name? What if Prince changes his name again? :)

Is there a comparison of various regexp tools' efficiency: are
character classes fast enough? would parenthesized groups be faster?
or character alternatives (like that [^±])?

Thank you.

-- 
With best regards,
Dmitri Minaev

Russian history blog: http://minaev.blogspot.com




reply via email to

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