--- a/lexers/LexSTTXT.cxx
+++ b/lexers/LexSTTXT.cxx
@@ -85,17 +85,22 @@
 				break;
 			}
 			case SCE_STTXT_HEXNUMBER: {
-				if(setHexNumber.Contains(sc.ch))
+				if (setHexNumber.Contains(sc.ch))
 					continue;
 				else if(setDataTime.Contains(sc.ch))
-					sc.SetState(SCE_STTXT_DATETIME);
+					sc.ChangeState(SCE_STTXT_DATETIME);
+				else if(setWord.Contains(sc.ch))
+					sc.ChangeState(SCE_STTXT_DEFAULT);
 				else
 					sc.SetState(SCE_STTXT_DEFAULT);
-
 				break;
 			}
 			case SCE_STTXT_DATETIME: {
-				if(!setDataTime.Contains(sc.ch))
+				if (setDataTime.Contains(sc.ch))
+					continue;
+				else if(setWord.Contains(sc.ch))
+					sc.ChangeState(SCE_STTXT_DEFAULT);
+				else
 					sc.SetState(SCE_STTXT_DEFAULT);
 				break;
 			}