Explicit pattern matching for capturing match refinement