$ 0 0 Just code-golfing Rebecca Chernoff's solution :-)alert(("This is a string.".match(/is/g) || []).length);