fix crash in a certain case

(i.e. the last thing in a file is "(^PlainText)WhiteSpace*$")