> For the complete documentation index, see [llms.txt](https://regex-simplify.lacostar.fr/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://regex-simplify.lacostar.fr/docs/discord/invite.md).

# invite

{% tabs %}
{% tab title="Function types" %}

```typescript
invite(link: string): { 
    include: boolean, 
    matchs: RegExpMatchArray | null, 
    groups: Array<{ code: string } | null> | null
}
```

{% endtab %}

{% tab title="Code example" %}
**Search user mention in a string:**

```javascript
const { discord } = require('regex-simplify');

const invite = discord.invite(`
    https://discord.gg/7prqAjux
    https://discord.com/invite/7prqAjux
    discord.gg/7prqAjux
    https://discord.com/7prqAjux
`);

console.log(invite);
```

{% endtab %}

{% tab title="Function return" %}

```javascript
{
  include: true,
  matchs: [
    'discord.gg/7prqAjux',
    'discord.com/invite/7prqAjux',
    'discord.gg/7prqAjux'
  ],
  groups: [
    [Object: null prototype] { code: '7prqAjux' },
    [Object: null prototype] { code: '7prqAjux' },
    [Object: null prototype] { code: '7prqAjux' }
  ]
}
```

{% endtab %}
{% endtabs %}
