This is an automated email from the ASF dual-hosted git repository.

tustvold pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow-rs.git


The following commit(s) were added to refs/heads/master by this push:
     new 5d757290d Add regexp_match docs (#3812)
5d757290d is described below

commit 5d757290dc39c6cd4b08309e081fe2b0dcffcf62
Author: Raphael Taylor-Davies <[email protected]>
AuthorDate: Tue Mar 7 17:58:57 2023 +0100

    Add regexp_match docs (#3812)
    
    * Add regexp_match docs
    
    * Update arrow-string/src/regexp.rs
    
    Co-authored-by: Liang-Chi Hsieh <[email protected]>
    
    ---------
    
    Co-authored-by: Liang-Chi Hsieh <[email protected]>
---
 arrow-string/src/regexp.rs | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/arrow-string/src/regexp.rs b/arrow-string/src/regexp.rs
index 4b1e2dcde..f3ba90d8a 100644
--- a/arrow-string/src/regexp.rs
+++ b/arrow-string/src/regexp.rs
@@ -157,6 +157,26 @@ pub fn regexp_is_match_utf8_scalar<OffsetSize: 
OffsetSizeTrait>(
 }
 
 /// 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.
+///
+/// [regexp_match]: 
https://www.postgresql.org/docs/current/functions-matching.html#FUNCTIONS-POSIX-REGEXP
 pub fn regexp_match<OffsetSize: OffsetSizeTrait>(
     array: &GenericStringArray<OffsetSize>,
     regex_array: &GenericStringArray<OffsetSize>,

Reply via email to