I have a form with a text field that the user is to enter a description of
an item. Sometimes a user --in spite of being told not to-- will enter the
filter their input to get rid of the all caps input.
It is OK if the user capitalizes each word, but words entered without
capitalization should stay that way. Single, double, and triple letter
words all caps would be considered OK, but anything longer should be reduced
to first-letter caps only. Exceptions would need be made for common words
(such as A, AS, OR, TO, ALL, AND, THE), which should be all lowercase.
Caps mixed with numbers would be OK.
Punctuation may need to taken into consideration.
Any suggestions on how to handle this?
Would regular expressions be a good approach? How exactly?