Why using isempty() does not return multiple values, like writeln(), but just single false :
:- use_module(library(regex)). isempty(Str) :- Str =~ \'^\\s*$\'.