我有一個像下面算括號內的數字字符串中的
*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+)\)/)
謝謝噓。你是一個拯救生命的人:) –