Skip to main content
Version: 1.3.0

Expr.str.contains_any

def contains_any(patterns: td_IntoExpr, ascii_case_insensitive: bool = False) -> Expr

Categories: string

Evaluate if the string contains any of the given patterns.

Parameters

parameter
patterns

The patterns to search for.

parameter
ascii_case_insensitive

If true, the search is case-insensitive.

Examples

>>> import tabsdata as td
>>>
>>> tf: td.TableFrame ...
>>>
>>> tf.select(td.col("a"), td.col("a")
.str.contains_any(["a", "b"]).alias("contains_any"))
>>>
┌──────┬──────────────┐
│ a ┆ contains_any │
------
strbool
╞══════╪══════════════╡
│ abc ┆ true │
│ axy ┆ true │
│ xyb ┆ true │
│ xyz ┆ false │
│ null ┆ null │
└──────┴──────────────┘