Is it possible to implement capture groups with regular expressions based on DFA, while preserving linear time complexity with respect to the input length?
- , . regex /a|(a)/; "a" .
, , , . , , .
, , , , , , , .
, . , , DFA. , , Wikipedia : " ".
, . . , , :
[...] , .
, /ab|(a)c/ /(a[bc])|ad/ . , , .