lib/pattern: add set of functions to parse combined pattern input