pub fn regexp_instr(
values: &dyn Array,
regex_array: &dyn Datum,
start_array: Option<&dyn Datum>,
nth_array: Option<&dyn Datum>,
flags_array: Option<&dyn Datum>,
subexpr_array: Option<&dyn Datum>,
) -> Result<Arc<dyn Array>, ArrowError>
Expand description
arrow-rs
style implementation of regexp_instr
function.
This function regexp_instr
is responsible for returning the index of a regular expression pattern
within a string array. It supports optional start positions and flags for case insensitivity.
The function accepts a variable number of arguments:
values
: The array of strings to search within.regex_array
: The array of regular expression patterns to search for.start_array
(optional): The array of start positions for the search.nth_array
(optional): The array of start nth for the search.endoption_array
(optional): The array of endoption positions for the search.flags_array
(optional): The array of flags to modify the search behavior (e.g., case insensitivity).subexpr_array
(optional): The array of subexpr positions for the search.
The function handles different combinations of scalar and array inputs for the regex patterns, start positions, and flags. It uses a cache to store compiled regular expressions for efficiency.
ยงErrors
Returns an error if the input arrays have mismatched lengths or if the regular expression fails to compile.