skaller wrote: > However I see no problem: just copy the array. The hard part is > knowing how long to make the C array for tre .. only tre knows > how many groups there are. Note that tre will not exceed the > specified array length .. you just lose the trailing groups. > > I think there's a way to find how many groups there are in a > compiled regex, isn't there? >
Yeah, I believe it's the function "nsub". tre_regexec already returns that along with the matches, so it'd be pretty easy to make the varray. I'll also add some ctors so it'll be a little easier to use than the not-exactly-obvious constructors mkiv and mkuiv. Should be pretty simple >> And speaking of data structures, what should we use as our default >> return type? varrays or lists? >> > > Probably a varray. The reason is Posix defines subgroups by integers. > It's not very nice, but that's the price for dynamic string regexps. > What do you think for in general? -e ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Felix-language mailing list Felix-language@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/felix-language