Yes, this is entirely possible. you can even explore the automaton eagerly and detect if it's possible to loop from an accepting state to a nonaccepting one.
Exciting stuff for future work
Exciting stuff for future work
https://docs.rs/regex-automata/latest/regex_automata/meta/st...
Ripgrep in turn exposes some knobs to tweak the heuristics
https://github.com/BurntSushi/ripgrep/blob/master/FAQ.md#how...