Pattern parser