in reply to Explaining a Regular Expression

In general, the go-to sources for information on regular expressions are perlre (manual) and perlretut (tutorial). In this particular case, I explained this exact regular expression on Friday in the 5th bullet of Re^3: Regular Expression Help!:

You could use anchors (^ and $) and * to do what you intend as well with $x=~/^\s*$/. This translates as requiring that between the start (^) and end ($) there is exactly 0 or more (*) whitespace characters (\s)
.