Closed ActualMasterOogway closed 2 months ago
I believe this is actually a misunderstanding of the regex crate's capture API; Regex::captures(haystack)
only gets the captures of the first match of the relevant regex in the given haystack. The thing that you want (and unfortunately isn't exposed at the moment) is captures_iter
, which returns an iterator that yields valid matches until the end of the given haystack.
Just as a proof of concept, this is an example of how captures_iter
could be exposed based on what I saw from the captures.rs
source file. Captures are only implemented as tables since the LuaCaptures
userdata is rather tightly restricted by its constructor and I didn't want to mess with the other files too much, but it's pretty much all you need to encapsulate the exposed functionality aside from the format
method.
This is just a proof of concept, ideally you would expose LuaCaptures
instead of tables in case you guys decide to expose more of the captures methods, but my brain is a bit too small (and I'm too lazy) to figure it out.
RegexCaptures can only return 1 capture
in this case #captures always returns
1
and the git hash would be0.633.1.6330512
, this shouldn't be the case, there are atleast 8 captures