corrected preg_match expression to look for leading spaces
added test for leading spaces fix