: match-group-regexp ( regexp n -- skip-regexp match-regexp )
[ [ options>> options>string ] [ raw>> ] bi ] dip
CHAR: ( pick nth-index cut CHAR: ) over index 1 + head
- rot '[ _ <optioned-regexp> ] bi@ ;
+ rot '[ H{ } [ _ <optioned-regexp> ] cache ] bi@ ;
: skip-first-match ( match regexp -- tailseq )
first-match [ seq>> ] [ to>> ] bi tail ;
[ string>> -rot update-match-groups ]
[ ignore-case?>> ] bi <string-matcher> ;
-M: regexp fixup-end
- [ raw>> [ -rot update-match-groups ] keep swap ]
- [ options>> options>string ] bi <optioned-regexp> {
+MEMO: <fixup-regexp> ( raw matched options -- regexp )
+ <optioned-regexp> {
[ parse-tree>> ] [ options>> ] [ dfa>> ] [ next-match>> ]
} cleave regexp boa ;
+M: regexp fixup-end
+ [ raw>> [ -rot update-match-groups ] keep swap ]
+ [ options>> options>string ] bi <fixup-regexp> ;
+
: fixup-end? ( text -- ? )
{ [ regexp? ] [ #match-groups ] } 1&& ;