me_equal.html)
    * [ polars.testing.assert_frame_not_equal ](../../api/polars.testing.assert_frame_not_equal.html)
    * [ polars.testing.assert_series_equal ](../../api/polars.testing.assert_series_equal.html)
    * [ polars.testing.assert_series_not_equal ](../../api/polars.testing.assert_series_not_equal.html)
    * [ polars.testing.parametric.dataframes ](../../api/polars.testing.parametric.dataframes.html)
    * [ polars.testing.parametric.series ](../../api/polars.testing.parametric.series.html)
    * [ polars.testing.parametric.column ](../../api/polars.testing.parametric.column.html)
    * [ polars.testing.parametric.columns ](../../api/polars.testing.parametric.columns.html)
    * [ polars.testing.parametric.create_list_strategy ](../../api/polars.testing.parametric.create_list_strategy.html)
    * [ polars.testing.parametric.load_profile ](../../api/polars.testing.parametric.load_profile.html)
    * [ polars.testing.parametric.set_profile ](../../api/polars.testing.parametric.set_profile.html)

  * [ Metadata ](../../metadata.html) __
    * [ polars.build_info ](../../api/polars.build_info.html)
    * [ polars.get_index_type ](../../api/polars.get_index_type.html)
    * [ polars.show_versions ](../../api/polars.show_versions.html)
    * [ polars.thread_pool_size ](../../api/polars.thread_pool_size.html)
    * [ polars.threadpool_size ](../../api/polars.threadpool_size.html)

  * [ __ ](../../../index.html)
  * [ Python API reference ](../../index.html)
  * __
  * [ String ](../string.html)
  * polars.Expr.... 

#  polars.Expr.str.extract_all  #

Expr.str.  extract_all  (  _ pattern  :  [ str  ](https://docs.python.org/3/library/stdtypes.html#str "\(in Python v3.12\)") |  Expr  _ )  →  Expr  [ [source]  ](https://github.com/pola-rs/polars/blob/main/py-polars/polars/expr/string.py#L1511-L1595) # 
    

Extract all matches for the given regex pattern.

Extract each successive non-overlapping regex match in an individual string as
a list. If the haystack string is ` null  ` , ` null  ` is returned.

Parameters  :

    

**pattern**

    

A valid regular expression pattern, compatible with the [ regex crate
](https://docs.rs/regex/latest/regex/) .

Returns  :

    

Expr

    

Expression of data type ` List(String)  ` .

Notes

To modify regular expression behaviour (such as “verbose” mode and/or case-
sensitive matching) with flags, use the inline ` (?iLmsuxU)  ` syntax. For
example:

    
    
    >>> df = pl.DataFrame(
    ...     data={
    ...         "email": [
    ...             "real.email@spam.com",
    ...             "some_account@somewhere.net",
    ...             "abc.def.ghi.jkl@uvw.xyz.co.uk",
    ...         ]
    ...     }
    ... )
    >>> # extract name/domain parts from the addresses, using verbose regex
    >>> df.with_columns(
    ...     pl.col("email")
    ...     .str.extract_all(
    ...         r"""(?xi)   # activate 'verbose' and 'case-insensitive' flags
    ...         [           # (start character group)
    ...           A-Z       # letters
    ...           0-9       # digits
    ...           ._%+\-    # special chars
    ...         ]           # (end character group)
    ...         +           # 'one or more' quantifier
    ...         """
    ...     )
    ...     .list.to_struct(fields=["name", "domain"])
    ...     .alias("email_parts")
    ... ).unnest("email_parts")
    shape: (3, 3)
    ┌───────────────────────────────┬─────────────────┬───────────────┐
    │ email                         ┆ name            ┆ domain        │
    │ ---                           ┆ ---             ┆ ---           │
    │ str                           ┆ str             ┆ str           │
    ╞═══════════════════════════════╪═════════════════╪═══════════════╡
    │ real.email@spam.com           ┆ real.email      ┆ spam.com      │
    │ some_account@somewhere.net    ┆ some_account    ┆ somewhere.net │
    │ abc.def.ghi.jkl@uvw.xyz.co.uk ┆ abc.def.ghi.jkl ┆ uvw.xyz.co.uk │
    └────────────────────