polars.Series.str.escape_regex#

Series.str.escape_regex() Series[source]#

Returns string values with all regular expression meta characters escaped.

Returns:
Series

Series of data type String.

Examples

>>> pl.Series(["abc", "def", None, "abc(\\w+)"]).str.escape_regex()
shape: (4,)
Series: '' [str]
[
    "abc"
    "def"
    null
    "abc\(\\w\+\)"
]