Hashtag regex pattern

Copy and test a JavaScript regex for hashtags, with examples and a one-click link to the regex tester.

Hashtag regex pattern

Validate whole value

Use anchors to check whether the complete value matches.

Regex: ^#[\p{L}\p{N}_]+$

Flags: u

Search in text

Find matching fragments inside a larger block of text.

Regex: #[\p{L}\p{N}_]+

Flags: gu

Examples that match

  • #launch
  • #Version2

Examples that do not match

  • launch
  • #two words