# text.like · Rell standard library · Chromia Docs (concept)

> pure function like(pattern: text ): boolean Matches this text against the specified SQL LIKE pattern. Use '_' to match any single character, and '%' to mat

Source: https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/text/like/

FUNCTION

# text.like

```signature
pure function like(pattern: text): boolean
```

Matches this text against the specified SQL LIKE pattern.

Use `'_'` to match any single character, and `'%'` to match any sequence of zero or more characters.
The escape sequences `'\\_'`, `'\\%'` and `'\\\\'` match the literal characters `'_'`, `'%'` and
`'\'` respectively.

Examples:

Rell

```
val names = ["Alice", "Victor", "Viktor", "Victoria", "V\\ctor"];
print(names @* { .like("Vi_tor") });  // prints [Victor, Viktor]
print(names @* { .like("Vic%") }); // prints [Victor, Victoria]
print(names @* { .like("V\\\\c%") }); // prints [V\ctor]
```

**Parameters**

* **pattern** — the pattern to match against

**See Also**

1. [Pattern Matching: LIKE - PostgreSQL Documentation](https://www.postgresql.org/docs/current/functions-matching.html#FUNCTIONS-LIKE)

Since 0.10.4

[View this page on docs.chromia.com](https://docs.chromia.com/pages/rell-stdlib/-rell%20-system%20-library/%5Broot%5D/text/like.html)Generated API reference, mirrored from the live docs
