trim word and numbers in java less than ten code example
Example 1: javascript create a function that counts the number of syllables a word has. each syllable is separated with a dash -.
function new_count(word) {
word = word.toLowerCase();
if(word.length <= 3) { return 1; }
word = word.replace(/(?:[^laeiouy]es|ed|[^laeiouy]e)$/, '');
word = word.replace(/^y/, '');
return word.match(/[aeiouy]{1,2}/g).length;
}
console.log(new_count('she'));
console.log(new_count('spain'))
console.log(new_count('softball'))
console.log(new_count('contagion'))
Example 2: pregmatch php only numbers and comma and dot
$regex="/^[0-9,]+$/";