The route pattern as a string (e.g., '/users/:id') or a direct RegExp object.
If true, the pattern will match paths that start with the route but may have additional segments.
If false (default), the pattern must match the entire path.
A Segment object containing the extracted keys and the compiled regular expression.
Parses a route string or regular expression into a
Segmentobject. This function converts human-readable route patterns (e.g.,'/users/:id') into a regular expression that can be used for matching URL paths, and extracts parameter names.