fixed regular expression for line formatting