diff --git a/py-polars/polars/utils/udfs.py b/py-polars/polars/utils/udfs.py index 81db4393d7a59..ae4964ea1cf44 100644 --- a/py-polars/polars/utils/udfs.py +++ b/py-polars/polars/utils/udfs.py @@ -206,7 +206,7 @@ def _get_target_name(self, col: str, expression: str) -> str: n = count() while True: name = f"srs{next(n)}" - if not re.search(rf"\bs{name}\b", search_expr): + if not re.search(rf"\b{name}\b", search_expr): return name raise NotImplementedError(f"TODO: apply_target = {self._apply_target!r}")