snowflake.snowpark.functions.regexp_count¶
- snowflake.snowpark.functions.regexp_count(subject: ColumnOrName, pattern: ColumnOrLiteralStr, position: Column | int = 1, *parameters: ColumnOrLiteral) Column [source] (https://github.com/snowflakedb/snowpark-python/blob/release-v1.3.0/src/snowflake/snowpark/functions.py#L1812-L1839)¶
Returns the number of times that a pattern occurs in the subject.
Example:
>>> df = session.sql("select * from values('apple'),('banana'),('peach') as T(a)") >>> df.select(regexp_count(col("a"), "a").alias("result")).show() ------------ |"RESULT" | ------------ |1 | |3 | |1 | ------------