in reply to Explaining a Regular Expression
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).
|
|---|