Function arrow_string::regexp::regexp_match
source · pub fn regexp_match(
array: &dyn Array,
regex_array: &dyn Datum,
flags_array: Option<&dyn Datum>,
) -> Result<ArrayRef, ArrowError>
Expand description
Extract all groups matched by a regular expression for a given String array.
Modelled after the Postgres regexp_match.
Returns a ListArray of GenericStringArray
with each element containing the leftmost-first
match of the corresponding index in regex_array
to string in array
If there is no match, the list element is NULL.
If a match is found, and the pattern contains no capturing parenthesized subexpressions,
then the list element is a single-element GenericStringArray
containing the substring
matching the whole pattern.
If a match is found, and the pattern contains capturing parenthesized subexpressions, then the
list element is a GenericStringArray
whose n’th element is the substring matching
the n’th capturing parenthesized subexpression of the pattern.
The flags parameter is an optional text string containing zero or more single-letter flags that change the function’s behavior.
§See Also
regexp_is_match
for matching (rather than extracting) a regular expression against an array of strings