Updated the regex to match empty lines