> 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/usermention.md).

# userMention

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

```typescript
userMention(user: string): { 
    include: boolean, 
    matchs: RegExpMatchArray | null, 
    groups: Array<{ id: string } | null> | null
}
```

{% endtab %}

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

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

const user = discord.userMention(`
    <@!584749055578603521>
    <@720256732630351912>
    <@507329636305207308>
`);

console.log(user);
```

{% endtab %}

{% tab title="Function return" %}

```javascript
{
  include: true,
  matchs: [
    '<@!584749055578603521>',
    '<@720256732630351912>',
    '<@507329636305207308>'
  ],
  groups: [
    [Object: null prototype] { id: '584749055578603521' },
    [Object: null prototype] { id: '720256732630351912' },
    [Object: null prototype] { id: '507329636305207308' }
  ]
}
```

{% endtab %}
{% endtabs %}
