snowflake.snowpark.functions.regexp_replace(subject: Union[Column, str], pattern: Union[Column, str], replacement: Union[Column, str] = '', position: Union[Column, int] = 1, occurrences: Union[Column, int] = 0, *parameters: Union[Column, None, bool, int, float, str, bytearray, Decimal, date, datetime, time, bytes, list, tuple, dict]) Column[source]

Returns the subject with the specified pattern (or all occurrences of the pattern) either removed or replaced by a replacement string. If no matches are found, returns the original subject.

>>> df = session.create_dataframe(
...     [["It was the best of times, it was the worst of times"]], schema=["a"]
... )
>>>"a"), lit("( ){1,}"), lit("")).alias("result")).show()
|"RESULT"                                  |
|Itwasthebestoftimes,itwastheworstoftimes  |