<commit_before>---
id: wildcards
title: Wildcards
---

Sometimes you will want to apply the same rules to all items of an array or all keys of some object.  
That's what the `*` character - also known as a wildcard -- is for.

For example, imagine you want to validate that all addresses have a valid postal code,
and that the number of each address is sanitized as an integer number.

We can do this with the following code:

```js
const express = require('express');
const { check, sanitize } = require('express-validator');<commit_msg>docs: small fixes in the wildcard feature (#843)<commit_after>---
id: wildcards
title: Wildcards
---

Sometimes you will want to apply the same rules to all items of an array or all keys of some object.  
That's what the `*` character -- also known as a wildcard -- is for.

For example, imagine you want to validate that all addresses have a valid postal code,
and that the number of each address is sanitized as an integer.

We can do this with the following code:

```js
const express = require('express');
const { check, sanitize } = require('express-validator');
{'fraction_non_alphanumeric': 0.08235294117647059, 'fraction_numerical': 0.0027149321266968325, 'mean_word_length': 3.981981981981982, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5416579', 'n_tokens_mistral': 303, 'n_tokens_neox': 289, 'n_words': 167}