我有这个数组的数组,我想通过它循环,给我每一个字,但从“@”,标点符号和标签剥离。然而,我的正则表达式是完全从数组中删除一些单词,我不知道为什么。正则表达式的JavaScript不工作
[ [ '@AIMEEE94x',
'@Arsenal_Geek',
'@Charlottegshore',
'shut',
'it',
'ha' ],
[ '"You',
'learn',
'so',
'much',
'@MesutOzil1088',
'and',
'@Alexis_Sanchez"',
'-',
'@alexiwobi:' ] ]
var regex = /\w+/g;
var listsb = [];
for (i = 0 ; i < tweetsA.length; i++) {
for(j = 0; j < tweetsA[i].length; j++){
if (regex.test(tweetsA[i][j])== true){
listsb = listsb.concat(tweetsA[i][j])
}
}
}
console.log(listsb);