-2
我想提取的字符串對應於「@」字樣,並將其保存在一個列表:Twitter的風格正則表達式匹配
例如:
"This is @crazy_boy crazy" should give ["crazy_boy"]
"This is @crazy_boy crazy @foobar" should give ["crazy_boy","foobar"]
"This statement is boring" should give [] //or whatever is an empty list
在蟒蛇
targets = re.findall(r'(?<[email protected])\w+', text)
上面的使用做的伎倆..但我不是很確定在java中。 感謝