Correct regular expression to check for whitespace nodes