gusblake
12-08-2009, 09:50 PM
Hi,
can anyone tell me how to detect any word (a-z only, surrounded by whitespace) less than 5 letters long?
Edit - this is what I have currently:
var RE=/\s([a-z]{1,4})\s/gi;
var string="some words"; //should be turned to "words"
string=string.replace(RE, "");
This is taking 4 letter chunks from the end of words.
Cheers,
Gus
Edit - fixed (replaced \s with \b)
can anyone tell me how to detect any word (a-z only, surrounded by whitespace) less than 5 letters long?
Edit - this is what I have currently:
var RE=/\s([a-z]{1,4})\s/gi;
var string="some words"; //should be turned to "words"
string=string.replace(RE, "");
This is taking 4 letter chunks from the end of words.
Cheers,
Gus
Edit - fixed (replaced \s with \b)