m[ ^ # From the start of the record ( # capture [^|]+ # everything that is not a pipe char ) \| # upto but excluding the first pipe char ]x