pattern parsing