your regular expression is checking to see if anything is entered. In other it is valid if any string is entered:
/\s*/i
Use this instead:
/^$/i
The ^ means the start of the string. $ means the end of the string. So it is only valid if there is nothing between the start and end of the string.