>_ IzzyLab

Topic breakdown

Extracting substrings by pattern is a job for grep with the -o flag (print not the whole line but only the matched fragment) in extended regular expression mode -E. The key idea is the character class [...], which defines the set of allowed characters for the token's "body"; several ranges and single characters are listed one after another inside a single pair of brackets. Many tools also offer the shorthand \w (letters, digits and underscore), but an explicit class makes it obvious exactly which characters a tag may contain.

What's checked

  1. Hashtags extracted
  2. All hashtags found

What it looks like