我有一个像下面算括号内的数字字符串中的
*WTY: but the light of the dining room suddenly turn off .
%mor: conj|but det|the n|light prep|of det|the adj|dining n|room adv|suddenly v|turn adv|off .
%snd: <00:14:74><00:25:53>
%WTY: {and} rpl but {suddenly} rpl (0.43) {the} * (1.07) {the light (0.78) suddenly turn off and} # (1.24) the light of the dining room suddenly turn off . err_m_s err_m_l ::: |
我想提取圆括号内的数字(),并计算这些数字的总和一个特定的字符串。 我已经尝试过以下RegEx提取数字,但它没有返回任何结果。
str.match(/\((\d+)\)/)
谢谢嘘。你是一个拯救生命的人:) –