Skip to content

Commit

Permalink
fixed example
Browse files Browse the repository at this point in the history
  • Loading branch information
barak1412 committed Oct 18, 2024
1 parent 2d29893 commit 2e48326
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions py-polars/polars/expr/string.py
Original file line number Diff line number Diff line change
Expand Up @@ -2790,16 +2790,16 @@ def escape_regex(self) -> Expr:
>>> df = pl.DataFrame({"text": ["abc", "def", None, "abc(\\w+)"]})
>>> df.with_columns(pl.col("text").str.escape_regex().alias("escaped"))
shape: (4, 2)
┌──────────┬──────────┐
│ text ┆ escaped │
│ --- ┆ --- │
│ str ┆ str │
╞══════════╪══════════╡
│ abc ┆ abc │
│ def ┆ def │
│ null ┆ null │
│ abc(\w+) ┆ abc(\w+) │
└──────────┴──────────┘
┌──────────┬──────────────
│ text ┆ escaped
│ --- ┆ ---
│ str ┆ str
╞══════════╪══════════════
│ abc ┆ abc
│ def ┆ def
│ null ┆ null
│ abc(\w+) ┆ abc\(\\w\+\) │
└──────────┴──────────────
"""
return wrap_expr(self._pyexpr.str_escape_regex())

Expand Down

0 comments on commit 2e48326

Please sign in to comment.