# Match

Partial and special matching during template assertions.

- Source: [`matching/lib/match.ts`](https://github.com/aws/aws-cdk/blob/v2.276.0/packages/aws-cdk-lib/matching/lib/match.ts#L11)
- Type last changed: v2.9.0 · 26 Jan 2022

## Initializer

```ts
new Match()
```

## Methods

- `absent(): Matcher` (static) — Use this matcher in the place of a field's value, if the field must not be present.

- `anyValue(): Matcher` (static) — Matches any non-null value at the target.

- `arrayEquals(pattern: any[]): Matcher` (static) — Matches the specified pattern with the array found in the same relative path of the target.

  The set of elements (or matchers) must match exactly and in order.

  **Parameters**

  - `pattern` — the pattern to match.

- `arrayWith(pattern: any[]): Matcher` (static) — Matches the specified pattern with the array found in the same relative path of the target.

  The set of elements (or matchers) must be in the same order as would be found.

  **Parameters**

  - `pattern` — the pattern to match.

- `exact(pattern: any): Matcher` (static) — Deep exact matching of the specified pattern to the target.

  **Parameters**

  - `pattern` — the pattern to match.

- `not(pattern: any): Matcher` (static) — Matches any target which does NOT follow the specified pattern.

  **Parameters**

  - `pattern` — the pattern to NOT match.

- `objectEquals(pattern: { [key: string]: any }): Matcher` (static) — Matches the specified pattern to an object found in the same relative path of the target.

  The keys and their values (or matchers) must match exactly with the target.

  **Parameters**

  - `pattern` — the pattern to match.

- `objectLike(pattern: { [key: string]: any }): Matcher` (static) — Matches the specified pattern to an object found in the same relative path of the target.

  The keys and their values (or matchers) must be present in the target but the target can be a superset.

  **Parameters**

  - `pattern` — the pattern to match.

- `serializedJson(pattern: any): Matcher` (static) — Matches any string-encoded JSON and applies the specified pattern after parsing it.

  **Parameters**

  - `pattern` — the pattern to match after parsing the encoded JSON.

- `stringLikeRegexp(pattern: string): Matcher` (static) — Matches targets according to a regular expression.
