SyntaxFix
Write A Post
Hire A Developer
Questions
The most portable regex would be ^[ \t\n]*$ to match an empty string (note that you would need to replace \t and \n with tab and newline accordingly) and [^ \n\t] to match a non-whitespace string.
^[ \t\n]*$
\t
\n
[^ \n\t]