[Top][All Lists]

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

Re: Emacs hangs on long words in .html files

From: Richard Stallman
Subject: Re: Emacs hangs on long words in .html files
Date: Mon, 04 Dec 2006 00:15:44 -0500

    -(defconst sgml-namespace-re "[_[:alpha:]][-_.[:alnum:]]*")
    -(defconst sgml-name-re "[_:[:alpha:]][-_.:[:alnum:]]*")
    +(defconst sgml-namespace-re "[_[:alpha:]][-_.[:alnum:]]\\{,64\\}")
    +(defconst sgml-name-re "[_:[:alpha:]][-_.:[:alnum:]]\\{,64\\}")
     (defconst sgml-tag-name-re (concat "<\\([!/?]?" sgml-name-re "\\)"))
     (defconst sgml-attrs-re "\\(?:[^\"'/><]\\|\"[^\"]*\"\\|'[^']*'\\)*")
     (defconst sgml-start-tag-regex (concat "<" sgml-name-re sgml-attrs-re)

    Whereas before it was taking 67 seconds to open a file containing a
    16,000 character 'word', I can now open the same file in about a tenth
    of a second.

Can someone please investigate why the search for
"[_[:alpha:]][-_.[:alnum:]]*" is so slow?
Is something badly implemented in regex.c?

reply via email to

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