Parse and pretty print patterns