Commit f4a6003b authored by Ben's avatar Ben
Browse files

Syntax

parent c495d80c
Loading
Loading
Loading
Loading
+0 −17
Original line number Original line Diff line number Diff line
@@ -111,21 +111,4 @@ export class HashtagsSelectorModalComponent {
      this._opts.onSelected();
      this._opts.onSelected();
    }
    }
  }
  }

  /**
   * Gets a list of all hashtags in a given string.
   * @input {string} inputText - The text to be searched.
   * @returns {Array<string>} - array of each hashtag (as a string).

   *  Credit to Arnaud Valensi - http://geekcoder.org/js-extract-hashtags-from-text/
   */
  sliceHashTags(inputText: any) {
    const regex = /(?:^|\s)(?:#)([a-zA-Z\d]+)/gm;
    let matches = [];
    let match;
    while ((match = regex.exec(inputText))) {
      matches.push(match[1]);
    }
    return matches;
  }
}
}