Expose regex::escape in Polars Python API
Polars uses the Rust regex crate as its regex engine. When building patterns it is sometimes desired to put an untrusted/unknown string as a literal in the regex. To do this correctly you need to escape that string. However, re.escape in Python is not the correct function for this, it should match the engine we use, so we need to expose regex::escape in our interface.
I would suggest exposing it as pl.escape_regex which directly works on Python strings, and pl.Expr.str.escape_regex which applies it to a column of strings.
@cmdlineluser Oops, I forgot to search for duplicates 😓
Good plan; can then retire this utility function: https://github.com/pola-rs/polars/blob/48f6e9dc7c62f60ee9cb2ef9313917b63c96b1f7/py-polars/polars/_utils/various.py#L626
@barak1412 would you be interested in this one? You are getting familiar with the Expressions setup.
@ritchie46 Sure! I am little sick now, but I will get to it in couple of days.
Ai, take care. :raised_hands:
@ritchie46 Thanks!
@orlp May you assign me please?