Index: lams_common/src/java/org/lamsfoundation/lams/util/ValidationUtil.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/util/ValidationUtil.java,v diff -u -r1.5.2.6 -r1.5.2.7 --- lams_common/src/java/org/lamsfoundation/lams/util/ValidationUtil.java 16 Feb 2017 03:57:34 -0000 1.5.2.6 +++ lams_common/src/java/org/lamsfoundation/lams/util/ValidationUtil.java 16 Feb 2017 04:08:38 -0000 1.5.2.7 @@ -220,9 +220,10 @@ int wordCount = 0; if ( text.length() > 0) { - wordCount = text.replaceAll("[\'\";:,\\.\\?\\-!]+", "").trim().split("\\S+").length;//.match(/\S+/g) || []) ; + String cleanedString = text.replaceAll("[\'\";:,\\.\\?\\-!]+", "").trim(); + wordCount = cleanedString.split("\\S+").length;//.match(/\S+/g) || []) ; // special case - if only one word and no spaces then the split array is empty. - if ( wordCount == 0 ) + if ( wordCount == 0 && cleanedString.length() > 0) wordCount = 1; }