I am trying to count the checkmarks in a given string. my string may be:
var myString = "one ✔ two ✔ three ✔"
myString.match(/✔/g) || ).length;
I have solved my problem:
I used the "unicode escape sequence"
\u with the 2714 unicode:
.match(/\u2714/g) || ).length;
The problem was likely due to a character encoding issue (see the comments on my question), but this solution seems to be a safe choice.