# compilePattern (@salmonui/core/data)

> The compilePattern function of @salmonui/core/data: Compiles like (% / = any sequence) or wildcard ( = any sequence, ? = one character) into an anchored RegExp.

Canonical: https://salmonui.dev/docs/reference/core/data/compilePattern

```ts
import { compilePattern } from '@salmonui/core/data';
```

Entry index: https://salmonui.dev/docs/reference/core/data (Markdown with every symbol of the entry: https://salmonui.dev/docs/reference/core/data.md).

## Reference

Kind: function

```ts
function compilePattern(pattern: string, operator: 'like' | 'wildcard'): RegExp;
```

Compiles `like` (`%` / `*` = any sequence) or `wildcard` (`*` = any sequence, `?` = one character) into an anchored RegExp.
