regular expression works for both liunx and Mac