improved pattern syntax. now it also supports optional parts