in reply to Reg Expression translation
/^\s*$/
is a common way of seeing if a string is empty or has just white space. Basically it matches if from the beginning ("^") to the end ("$") where there is nothing or only white space ("\s*") between.
/^\w{1,}@/
is just another way of writing
/^\w+@/
which matches one or more "word" characters ("\w+") followed by "@" at the beginning of the line ("^")