emacs-devel
[Top][All Lists]
Advanced

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

Limits on the regexp string length


From: Ihor Radchenko
Subject: Limits on the regexp string length
Date: Wed, 21 Dec 2022 12:51:11 +0000

Hi,

I am writing as a follow-up of a recent bug report we got in Org.

Rudolf Adamkovič <salutis@me.com> (December 14) (2022 emacs-orgmode.gnu.org 
inbox maillist replied)
Subject: Radio links work only in small numbers
https://orgmode.org/list/m2lenax5m6.fsf@me.com

It looks like the length of regular expressions in Emacs is limited and
regexps exceeding this length cause error being thrown: "Regular
expression too big".

Is there any rationale behind this limit? Can we increase it somehow
from Elisp?

The regexps in question are giant (or re1 re2 ...) where we are
searching for occurrences of word combinations from list.

The compiled discrete automata should not occupy too much memory. No more
than ~ max_phrase_length * char_table_size.

P.S. Note that `regexp-opt' is not suitable because we need to match
arbitrary numbers of newlines/spaces inside the word combinations
equally.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>



reply via email to

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