in that regex you're using, doesn't . stand for any character, so spaces would be included?
One very crude way you could do it is to just do something like:
while(pull off first word of string)
check length of word
possibly put a <br> inside the word
add word to new string
end while
Or, could you just fix the width of the table column?