Well, if you need gmatch3 then it won't do. But if gmatch1 and gmatch2 are
enough, use C++-like approach and make those a proc which returns a structure
with items and pairs iterators.
type MatchWrap = distinct seq[string]
proc gmatch(src, pat: string): MatchWrap =
let c = src.match(pat)
MatchWrap(c)
iterator items(wrap: MatchWrap): string =
yield seq[string](wrap)[0]
iterator pairs(wrap: MatchWrap): (string,string) =
yield (seq[string](wrap)[0], seq[string](wrap)[1])
- Looking for efficient API for regexp library zevv
- Re: Looking for efficient API for regexp library boia01
- Re: Looking for efficient API for regexp library Udiknedormin
