How do I find match offsets with a RegexSet
using the C API?
#973
-
It is possible I have just missed this functionality, if so then please close! I am trying to consume the C API for this library. It appears to be missing some of the Regex Set features found in the Rust API, such as iterating over all of the matches. Is this functionality supported? If not, are there any plans to add it? |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 1 reply
-
Could you please point to the specific Rust APIs that don't have a C API equivalent? I might also suggest taking another look through the RegexSet docs. They specifically outline what is supported. |
Beta Was this translation helpful? Give feedback.
-
I was unable to find a method for getting all of the matches in a haystack for a set of regexes. I think this is possibe in Rust using this method? https://github.com/rust-lang/regex/blob/master/src/re_set.rs#L219-L226 |
Beta Was this translation helpful? Give feedback.
-
Okay... And could you please explain what |
Beta Was this translation helpful? Give feedback.
-
My understanding is that rure_set_matches will return an array of boolean values indicating if any match was found for each pattern in the regex set. However, I think the Rust version allows you to get the start/end positions of the matches? Sorry if this isn't the case - I am not very familiar with C and even less so with Rust! |
Beta Was this translation helpful? Give feedback.
-
Yes, this is why I suggested that you read the
|
Beta Was this translation helpful? Give feedback.
Yes, this is why I suggested that you read the
RegexSet
docs. In particular, see its Limitations section. In short, no,RegexSet
does not provide the ability to find offsets.regex-automata 0.3
will enable finding the offsets, but only through lower level APIs. And I don't have any plans to expose that as a C API.