str="hello world"; re='[[:space:]]'; if [[ $str =~ $re ]]; then echo "matched"; fi
Standard input is empty
matched
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!