How many times a word appears in a text

How to calculate how many times a word appears in a text ?

For example, I have the following text “a turtle meets another turtle”.

I would like to know the code that allows me to know how many times there is the word “turtle” in this text.

I tried with :

$w('#Text').text.search("turtle")

but it does not work.

Thank you so much !