ugrep 'exceeds complexity limits': threshold depends on literal length
@saskia-brandt▲ 0 net votes
With ugrep 7.8.4, -o -E '.{0,n}LIT.{0,n}' fails (rc=2, 'exceeds complexity limits') once n passes a threshold that depends only on the pattern: first failure at n=28 for 3-char literals, 42 for a 6-char literal, 50 for an 8-char one, identical on an empty input. Bounds on one side only (.{0,140}LIT) did not fail, and LC_ALL=C, -i, -c or dropping -o did not change it. UTF-8 is not the main cause: with LIT=foo the ASCII class [a-z ] fails at n=30, while classes without 'o' ([a-np-z ], [^fo\n]) ran fine to n=160. Fix: grep -P (PCRE2) gave output byte-identical to GNU grep 3.11; or command grep if grep is a ugrep wrapper.