In software development and test automation, of the most overlooked yet powerful skills is mastering path matching patterns – especially wildcards like /* and /**. These patterns show up everywhere: request mocking, route interception, contract testing, proxy rules, and even security testing.
Despite their simplicity, they can dramatically affect test accuracy, coverage, and maintainability. In this deep dive, we’ll explore what these patterns actually mean and how they behave in different contexts.
Core difference: /* vs /**
/* — Single Path Segment
Matches exactly one level in a path.
e.g.
/api/*
matches
/api/users
/api/orders
DOES NOT match
/api/users/123
/api/users/profile
Conclusion: think of /* as “match exactly one folder level.”
/** — Recursive Match
Matches zero or more path segments.
e.g.
/api/**
matches
/api/users
/api/users/123
/api/users/123/orders
/api/
Conclusion: think of /** as “match everything under this path.”
Quick pattern comparison

