---
url: https://lit-ui-router.dev/reference/ui-router-server/matcher/functions/exec.md
---
[ui-router-server](../../index.md) / [matcher](../index.md) / exec

# Function: exec()

```ts
function exec(matcher, path): 
  | RawParams
  | null;
```

Defined in: [url-matcher.ts:637](https://github.com/simshanith/lit-ui-router/blob/740888c2b2ba358c4dfa52a122e927df6a604b12/packages/ui-router-server/src/url-matcher.ts#L637)

Tests a url path against a compiled matcher.

Returns the captured parameter values when the path matches the pattern,
or null when it does not. Search params always appear in the result,
resolved to their static defaults (undefined when none is declared).

## Parameters

| Parameter | Type |
| ------ | ------ |
| `matcher` | [`CompiledMatcher`](../interfaces/CompiledMatcher.md)<`unknown`> |
| `path` | `string` |

## Returns

| [`RawParams`](https://ui-router.github.io/core/docs/latest/interfaces/_params_interface_.rawparams.html)
| `null`
