查找文本 javascript
我有字符串随机长度
例如:
sadsadsadsad(323213)dfsssds悲伤悲伤(321)dfsssds
如何找到括号中的值?
取值随机长度
感谢阅读
解决方案试试这个:
var str = 'sadsadsadsad(321)dfss888s(120)ds';str.match(/(d+)/g).map ( value => { console.log( value.replace(/[)(]/g, '') ) } );
上一个>I Have string random length
Ex:
sadsadsadsad(323213)dfsssds sadsadsadsad(321)dfsssds
How can I find the values in brackets?.
Value random length
Thank for reading
解决方案Try This:
var str = 'sadsadsadsad(321)dfss888s(120)ds'; str.match(/(d+)/g).map ( value => { console.log( value.replace(/[)(]/g, '') ) } );
相关文章