class_docstr: Series.str namespace.
class_docstr_tok: ["Series.str","namespace","."]
docstr: Extract all capture groups for the given regex pattern.
  
  Parameters
  ----------
  pattern
      A valid regular expression pattern, compatible with the `regex crate
      <https://docs.rs/regex/latest/regex/>`_.
  
  Notes
  -----
  All group names are **strings**.
  
  If your pattern contains unnamed groups, their numerical position is converted
  to a string.
  
  For example, we can access the first group via the string `"1"`::
  
      >>> (
      ...     pl.Series(["foo bar baz"])
      ...     .str.extract_groups(r"(\w+) (.+) (\w+)")
      ...     .struct["1"]
      ... )
      shape: (1,)
      Series: '1' [str]
      [
          "foo"
      ]
  
  Returns
  -------
  Series
      Series of data type :class:`Struct` with fields of data type
      :class:`String`.
  
  Examples
  --------
  >>> s = pl.Series(
  ...     name="url",
  ...     values=[
  ...         "http://vote.com/ballon_dor?candidate=messi&ref=python",
  ...         "http://vote.com/ballon_dor?candidate=weghorst&ref=polars",
  ...         "http://vote.com/ballon_dor?error=404&ref=rust",
  ...     ],
  ... )
  >>> s.str.extract_groups(r"candidate=(?<candidate>\w+)&ref=(?<ref>\w+)")
  shape: (3,)
  Series: 'url' [struct[2]]
  [
      {"messi","python"}
      {"weghorst","polars"}
      {null,null}
  ]
docstr_tok: ["Extract","all","capture","groups","for","the","given","regex","pattern",".","Parameters","--","--","--","--","--","pattern","A","valid","regular","expression","pattern",",","compatible","with","the","`","regex","crate","<","https",":","\/\/docs.rs\/regex\/latest\/regex\/",">","`","_",".","Notes","--","--","-","All","group","names","are","*","*","strings","*","*",".","If","your","pattern","contains","unnamed","groups",",","their","numerical","position","is","converted","to","a","string",".","For","example",",","we","can","access","the","first","group","via","the","string","`","``","1","''","`",":",":",">",">",">","(","...","pl.Series","(","[","``","foo","bar","baz","''","]",")","...",".str.extract_groups","(","r","''","(","\\w+",")","(",".+",")","(","\\w+",")","''",")","...",".struct","[","``","1","''","]","...",")","shape",":","(","1",",",")","Series",":","'","1","'","[","str","]","[","``","foo","''","]","Returns","--","--","--","-","Series","Series","of","data","type",":","class",":","`","Struct","`","with","fields","of","data","type",":","class",":","`","String","`",".","Examples","--","--","--","--",">",">",">","s","=","pl.Series","(","...","name=","''","url","''",",","...","values=","[","...","``","http",":","\/\/vote.com\/ballon_dor","?","candidate=messi","&","ref=python","''",",","...","``","http",":","\/\/vote.com\/ballon_dor","?","candidate=weghorst","&","ref=polars","''",",","...","``","http",":","\/\/vote.com\/ballon_dor","?","error=404","&","ref=rust","''",",","...","]",",","...",")",">",">",">","s.str.extract_groups","(","r","''","candidate=","(","?","<","candidate",">","\\w+",")","&","ref=","(","?","<","ref",">","\\w+",")","''",")","shape",":","(","3",",",")","Series",":","'url","'","[","struct","[","2","]","]","[","{","``","messi","''",",","''","python","''","}","{","``","weghorst","''",",","''","polars","''","}","{","null",",","null","}","]"]
code: def extract_groups(self, pattern: str) -> Series:
      r"""
      Extract all capture groups for the given regex pattern.
  
      Parameters
      ----------
      pattern
          A valid regular expression pattern, compatible with the `regex crate
          <https://docs.rs/regex/latest/regex/>`_.
  
      Notes
      -----
      All group names are **strings**.
  
      If your pattern contains unnamed groups, their numerical position is converted
      to a string.
  
      For example, we can access the first group via the string `"1"`::
  
          >>> (
          ...     pl.Series(["foo bar baz"])
          ...     .str.extract_groups(r"(\w+) (.+) (\w+)")
          ...     .struct["1"]
          ... )
          shape: (1,)
          Series: '1' [str]
          [
              "foo"
          ]
  
      Returns
      -------
      Series
          Series of data type :class:`Struct` with fields of data type
          :class:`String`.
  
      Examples
      --------
      >>> s = pl.Series(
      ...     name="url",
      ...     values=[
      ...         "http://vote.com/ballon_dor?candidate=messi&ref=python",
      ...         "http://vote.com/ballon_dor?candidate=weghorst&ref=polars",
      ...         "http://vote.com/ballon_dor?error=404&ref=rust",
      ...     ],
      ... )
      >>> s.str.extract_groups(r"candidate=(?<candidate>\w+)&ref=(?<ref>\w+)")
      shape: (3,)
      Series: 'url' [struct[2]]
      [
          {"messi","python"}
          {"weghorst","polars"}
          {null,null}
      ]
  
      """
  
imports: from __future__ import annotations
  from typing import TYPE_CHECKING
  from polars.series.utils import expr_dispatch
  from polars.utils.deprecation import deprecate_renamed_function, deprecate_renamed_parameter
label_desc: Use image node_id 19 for calling the StringNameSpace obj's underlying member method code with example usage: obj.extract_groups(pattern) without return types