Loading src/app/modules/hashtags/hashtag-selector-modal/hashtags-selector.component.ts +0 −17 Original line number Original line Diff line number Diff line Loading @@ -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; } } } Loading
src/app/modules/hashtags/hashtag-selector-modal/hashtags-selector.component.ts +0 −17 Original line number Original line Diff line number Diff line Loading @@ -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; } } }