Identifiersflags: g

Slack User Mention

Match Slack user mentions in their raw form <@U01234ABC> as delivered by the Events API.

Try it in RegexPro

Pattern

regexJavaScript
/<@U[A-Z0-9]{8,}>/g

Raw source: <@U[A-Z0-9]{8,}>

How it works

Literal <@U prefix, then 8 or more uppercase alphanumeric characters (Slack's ID alphabet), closed by >. Matches user IDs regardless of legacy or modern length.

Examples

Input

cc <@U01234ABC> please review

Matches

  • <@U01234ABC>

Input

pinged <@UABCDEF123GH> earlier

Matches

  • <@UABCDEF123GH>

Input

no mentions

No match

Common use cases

  • Slack bot payload parsing
  • Notification auditing
  • @mention frequency analytics
  • Channel migration tooling