Counting the occurrence of a character in a string

Hi everyone!
I hope I'm writing in the right section. I also searched a bit on the forum and I couldn't find any topic on this subject...

I have a string with artist names separated by commas, and I need to know how many artist are in that string.
Is it possible, for example, to know how many times regexp replaced something?

Any other way I?

Thanks a lot,
Dario

This should give you the number of artists:
$add($len($regexp(%artist%,'[^,]',)),1)

no comma = one artist
one comma = two artists
two commas = three artists
....

Thank you very much! This is a very interesting solution :slight_smile:

The following proposal could also be of interest.

$len($regexp([%ARTIST%','],'[^,]',))

no artist --> 0
no comma --> one artist --> 1
one comma --> two artists --> 2
two commas --> three artists--> 3

DD.20150702.1103.CEST