> For the complete documentation index, see [llms.txt](https://blobbi.gitbook.io/fractale/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://blobbi.gitbook.io/fractale/examples/regexp.md).

# RegExp key model

## Models

```javascript
const ModelWithRegExpAsKey = Fractale.create("ModelWithRegExpAsKey", {
    "/item_\\d+/i": String
});
```

## Run

```javascript
const { ModelWithRegExpAsKey } = module.exports.get();
const instance = new ModelWithRegExpAsKey({
    item_1: 'Foo',
    item_2: 'Bar',
});

_.test(instance.item_1, 'Foo', 'Error on regexp key accessor with type string');
_.test(instance.item_2, 'Bar', 'Error on regexp key accessor with type string');

resolve(instance);
```

## Results

```javascript
{
    "uuid": "1e35cacd-193c-4cff-bbbb-d687f6023426",
    "item_1": "Foo",
    "item_2": "Bar"
}
```
