function Compter(chaine, formulaire) { var exp=new RegExp("[a-zA-Z0-9éèêëàáâäóòôöíìîïçÉÈÊËÀÁÂÄÒÓÔÖÌÍÎÏÇ-]+","g"); var tabNom=chaine.match(exp); if (tabNom==null) {formulaire.compte.value = "Tu as écrit 0 mot";} else if (tabNom.length==1) {formulaire.compte.value = "Tu as écrit 1 mot";} else if (tabNom.length>=250) {formulaire.compte.value = "Tu as écrit plus de 250 mots soit " + tabNom.length +" mots. Tu peux poster !";} else { var affichage= "Tu as écrit" + " " + tabNom.length + " " + "mots"; formulaire.compte.value = affichage; } }