Why doesn’t this simple bash regex return true?

If I do [[ "0" =~ "^[0-9]+$" ]] && echo hello at a terminal I would expect to see the word “hello”

However, nothing gets printed. What am I doing wrong?


Source: regex

Leave a Reply