Fix prompt patterns to include optional space and hard line-endings