v.21.1New Features
Add countMatches and countMatchesCaseInsensitive functions
Add functionscountMatches/countMatchesCaseInsensitive. #17459 (Azat Khuzhin).
Why it matters
These functions solve the problem of efficiently counting how many times a substring or regex pattern appears within a string. This enhances text processing capabilities in ClickHouse by providing an easy way to perform frequency analysis directly within SQL queries.How to use it
Use the functionscountMatches(haystack, needle) for case-sensitive counting and countMatchesCaseInsensitive(haystack, needle) for case-insensitive counting where haystack is the string to search in and needle is the substring or regex pattern to count.