Contact: aviboots(AT)netvision.net.il
38,490 questions
50,157 answers
573 users
const s = 'javascript php c c++ javascript javascript'; const regExp = /javascript/g; const result = s.match(regExp); console.log(result.length); /* run: 3 */
const s = 'javascript php c c++ javascript javascript'; const word = "javascript"; const regExp = new RegExp(word, 'g'); console.log(s.match(regExp).length); /* run: 3 */