class_docstr: Namespace for string related expressions.
class_docstr_tok: ["Namespace","for","string","related","expressions","."]
docstr: Use the aho-corasick algorithm to replace many matches.
  
  Parameters
  ----------
  patterns
      String patterns to search and replace.
  replace_with
      Strings to replace where a pattern was a match.
      This can be broadcasted. So it supports many:one and many:many.
  ascii_case_insensitive
      Enable ASCII-aware case insensitive matching.
      When this option is enabled, searching will be performed without respect
      to case for ASCII letters (a-z and A-Z) only.
  
  Examples
  --------
  >>> _ = pl.Config.set_fmt_str_lengths(100)
  >>> df = pl.DataFrame(
  ...     {
  ...         "lyrics": [
  ...             "Everybody wants to rule the world",
  ...             "Tell me what you want, what you really really want",
  ...             "Can you feel the love tonight",
  ...         ]
  ...     }
  ... )
  >>> df.with_columns(
  ...     pl.col("lyrics")
  ...     .str.replace_many(
  ...         ["me", "you", "they"],
  ...         "",
  ...     )
  ...     .alias("removes_pronouns")
  ... )
  shape: (3, 2)
  ┌────────────────────────────────────────────────────┬────────────────────────────────────────────┐
  │ lyrics                                             ┆ removes_pronouns                           │
  │ ---                                                ┆ ---                                        │
  │ str                                                ┆ str                                        │
  ╞════════════════════════════════════════════════════╪════════════════════════════════════════════╡
  │ Everybody wants to rule the world                  ┆ Everybody wants to rule the world          │
  │ Tell me what you want, what you really really want ┆ Tell  what  want, what  really really want │
  │ Can you feel the love tonight                      ┆ Can  feel the love tonight                 │
  └────────────────────────────────────────────────────┴────────────────────────────────────────────┘
  >>> df.with_columns(
  ...     pl.col("lyrics")
  ...     .str.replace_many(
  ...         ["me", "you"],
  ...         ["you", "me"],
  ...     )
  ...     .alias("confusing")
  ... )  # doctest: +IGNORE_RESULT
  shape: (3, 2)
  ┌────────────────────────────────────────────────────┬───────────────────────────────────────────────────┐
  │ lyrics                                             ┆ confusing                                         │
  │ ---                                                ┆ ---                                               │
  │ str                                                ┆ str                                               │
  ╞════════════════════════════════════════════════════╪═══════════════════════════════════════════════════╡
  │ Everybody wants to rule the world                  ┆ Everybody wants to rule the world                 │
  │ Tell me what you want, what you really really want ┆ Tell you what me want, what me really really want │
  │ Can you feel the love tonight                      ┆ Can me feel the love tonight                      │
  └────────────────────────────────────────────────────┴───────────────────────────────────────────────────┘
docstr_tok: ["Use","the","aho-corasick","algorithm","to","replace","many","matches",".","Parameters","--","--","--","--","--","patterns","String","patterns","to","search","and","replace",".","replace_with","Strings","to","replace","where","a","pattern","was","a","match",".","This","can","be","broadcasted",".","So","it","supports","many",":","one","and","many",":","many",".","ascii_case_insensitive","Enable","ASCII-aware","case","insensitive","matching",".","When","this","option","is","enabled",",","searching","will","be","performed","without","respect","to","case","for","ASCII","letters","(","a-z","and","A-Z",")","only",".","Examples","--","--","--","--",">",">",">","_","=","pl.Config.set_fmt_str_lengths","(","100",")",">",">",">","df","=","pl.DataFrame","(","...","{","...","``","lyrics","''",":","[","...","``","Everybody","wants","to","rule","the","world","''",",","...","``","Tell","me","what","you","want",",","what","you","really","really","want","''",",","...","``","Can","you","feel","the","love","tonight","''",",","...","]","...","}","...",")",">",">",">","df.with_columns","(","...","pl.col","(","``","lyrics","''",")","...",".str.replace_many","(","...","[","``","me","''",",","``","you","''",",","``","they","''","]",",","...","``","''",",","...",")","...",".alias","(","``","removes_pronouns","''",")","...",")","shape",":","(","3",",","2",")","\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510","\u2502","lyrics","\u2506","removes_pronouns","\u2502","\u2502","--","-","\u2506","--","-","\u2502","\u2502","str","\u2506","str","\u2502","\u255e\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2561","\u2502","Everybody","wants","to","rule","the","world","\u2506","Everybody","wants","to","rule","the","world","\u2502","\u2502","Tell","me","what","you","want",",","what","you","really","really","want","\u2506","Tell","what","want",",","what","really","really","want","\u2502","\u2502","Can","you","feel","the","love","tonight","\u2506","Can","feel","the","love","tonight","\u2502","\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518",">",">",">","df.with_columns","(","...","pl.col","(","``","lyrics","''",")","...",".str.replace_many","(","...","[","``","me","''",",","``","you","''","]",",","...","[","``","you","''",",","``","me","''","]",",","...",")","...",".alias","(","``","confusing","''",")","...",")","#","doctest",":","+IGNORE_RESULT","shape",":","(","3",",","2",")","\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510","\u2502","lyrics","\u2506","confusing","\u2502","\u2502","--","-","\u2506","--","-","\u2502","\u2502","str","\u2506","str","\u2502","\u255e\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u256a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2561","\u2502","Everybody","wants","to","rule","the","world","\u2506","Everybody","wants","to","rule","the","world","\u2502","\u2502","Tell","me","what","you","want",",","what","you","really","really","want","\u2506","Tell","you","what","me","want",",","what","me","really","really","want","\u2502","\u2502","Can","you","feel","the","love","tonight","\u2506","Can","me","feel","the","love","tonight","\u2502","\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518"]
code: def replace_many(
      self,
      patterns: IntoExpr,
      replace_with: IntoExpr,
      *,
      ascii_case_insensitive: bool = False,
  ) -> Expr:
      """
  
      Use the aho-corasick algorithm to replace many matches.
  
      Parameters
      ----------
      patterns
          String patterns to search and replace.
      replace_with
          Strings to replace where a pattern was a match.
          This can be broadcasted. So it supports many:one and many:many.
      ascii_case_insensitive
          Enable ASCII-aware case insensitive matching.
          When this option is enabled, searching will be performed without respect
          to case for ASCII letters (a-z and A-Z) only.
  
      Examples
      --------
      >>> _ = pl.Config.set_fmt_str_lengths(100)
      >>> df = pl.DataFrame(
      ...     {
      ...         "lyrics": [
      ...             "Everybody wants to rule the world",
      ...             "Tell me what you want, what you really really want",
      ...             "Can you feel the love tonight",
      ...         ]
      ...     }
      ... )
      >>> df.with_columns(
      ...     pl.col("lyrics")
      ...     .str.replace_many(
      ...         ["me", "you", "they"],
      ...         "",
      ...     )
      ...     .alias("removes_pronouns")
      ... )
      shape: (3, 2)
      ┌────────────────────────────────────────────────────┬────────────────────────────────────────────┐
      │ lyrics                                             ┆ removes_pronouns                           │
      │ ---                                                ┆ ---                                        │
      │ str                                                ┆ str                                        │
      ╞════════════════════════════════════════════════════╪════════════════════════════════════════════╡
      │ Everybody wants to rule the world                  ┆ Everybody wants to rule the world          │
      │ Tell me what you want, what you really really want ┆ Tell  what  want, what  really really want │
      │ Can you feel the love tonight                      ┆ Can  feel the love tonight                 │
      └────────────────────────────────────────────────────┴────────────────────────────────────────────┘
      >>> df.with_columns(
      ...     pl.col("lyrics")
      ...     .str.replace_many(
      ...         ["me", "you"],
      ...         ["you", "me"],
      ...     )
      ...     .alias("confusing")
      ... )  # doctest: +IGNORE_RESULT
      shape: (3, 2)
      ┌────────────────────────────────────────────────────┬───────────────────────────────────────────────────┐
      │ lyrics                                             ┆ confusing                                         │
      │ ---                                                ┆ ---                                               │
      │ str                                                ┆ str                                               │
      ╞════════════════════════════════════════════════════╪═══════════════════════════════════════════════════╡
      │ Everybody wants to rule the world                  ┆ Everybody wants to rule the world                 │
      │ Tell me what you want, what you really really want ┆ Tell you what me want, what me really really want │
      │ Can you feel the love tonight                      ┆ Can me feel the love tonight                      │
      └────────────────────────────────────────────────────┴───────────────────────────────────────────────────┘
  
      """  # noqa: W505
      patterns = parse_as_expression(
          patterns, str_as_lit=False, list_as_lit=False
      )
      replace_with = parse_as_expression(
          replace_with, str_as_lit=True, list_as_lit=False
      )
      return wrap_expr(
          self._pyexpr.str_replace_many(
              patterns, replace_with, ascii_case_insensitive
          )
      )
  
imports: from __future__ import annotations
  import warnings
  from typing import TYPE_CHECKING
  import polars._reexport
  from polars import functions
  from polars.datatypes import Date, Datetime, Int32, Time, py_type_to_dtype
  from polars.exceptions import ChronoFormatWarning
  from polars.utils._parse_expr_input import parse_as_expression
  from polars.utils._wrap import wrap_expr
  from polars.utils.deprecation import deprecate_renamed_function, deprecate_renamed_parameter, rename_use_earliest_to_ambiguous
  from polars.utils.various import find_stacklevel
label_desc: Use image node_id 52 for calling the ExprStringNameSpace obj's underlying member method code with example usage: obj.replace_many(patterns, replace_with) and returns: wrap_expr