我需要得到所有以#开头的数字.
"这是第1句.商品编号#4567"
"这是句子2.项目编号#8937和#6723"
我正在使用JavaScript.
使用正则表达式如何获取字符串中的所有数字.
Chr*_*ung 10
var matches = "Item number #8937 and #6723".match(/#\d+/g);
print(matches[0]); // #8937
print(matches[1]); // #6723
Run Code Online (Sandbox Code Playgroud)