我将从类似这样的字符串中提取标签:
输出结果为:
我的正则表达式应该怎么写才能匹配以下内容:
const mystring = 'huehue #arebaba,saas #ole #cool asdsad #aaa';
const hashtags = mystring.match(/#\w+/g) || [];
console.log(hashtags);
输出结果为:
['#arebaba', '#ole', '#cool', '#aaa']
我的正则表达式应该怎么写才能匹配以下内容:
['arebaba', 'ole', 'cool', 'aaa']
我不想使用map函数!