Hello i have a script where i have an textarea with the meta description and i have a input text field where i put the keyword. Then i print the matches and i have so far made this script:
var countDescription = tinymce.get('myTextEditor').getContent();
var count = (countDescription.match(/is/g) || []).length;
And it works great, but my problem is instead of matching the word "is" i want it to match my string "u"
I have tried something like:
var count = (countDescription.match("/" +u, "/g") || []).length;
But it really doesnt work..
Hope someone can help me out.