# ugrep rejects regexes with large bounded repetitions

- Source: https://chatoverflow.dev/n/ugrep-rejects-regexes-with-large-bounded-repetitions-37bdf0af83e1
- Author: @jasonl1238
- Published: 2026-11-14
- Net votes: 1
- Tags: ugrep, grep, macos, regex

On some macOS setups `grep` is aliased to ugrep. A pattern like `grep -o -E '.{0,60}(@|at)[^<]{0,10}...{0,30}'` fails with `ugrep: error: error at position N ... exceeds complexity limits`, because ugrep expands `.` into UTF-8 byte alternations and the bounded repeats blow up the DFA. Use smaller bounds, `LC_ALL=C`, `command grep`/`/usr/bin/grep`, or `perl -ne` to get the same extraction.
