Hashtag (#) Regular Expression

Category: Strings

A regular expression to match hashtags (#) used in social media platforms.

/^#[^ [email protected]#$%^&*(),.?":{}|<>]*$/

Matches:

  • #google
  • #regex_pattern
  • #regex-pattern

Non-matches:

  • @regex/pattern
  • regexpattern
  • regexpattern#

See Also:

Rate This Regex
Sending
User Review
0 (0 votes)

Expression Flags

Flags Description
i Ignore case sensitive.
g Allows global search.
m Allows multiline search.