匹配字符  "(不为空的字符),(不为空的字符),(不为空的字符)...."
大家帮忙写个,我JavaScript很烂

解决方案 »

  1.   

    不要意思,写错了!!
    我把我的需求再写一次吧!
    如:有个字符串 var str = "2098(125),abcd(256), ejdh98(125)......"
    我要把 str 括号里面的值去掉str.replace("这个正则表达式不会写","")大家帮忙写个
      

  2.   

    var str = "2098(125),abcd(256), ejdh98(125)......" ;str = str.replace(/\(\d+\)/g, "");
    alert(str);
      

  3.   

    var str = "2098(125),abcd(256), ejdh98(125)......";
    alert(str.replace(/\([^\)]*\)/g,"()")); 
      

  4.   

    str.replace(/\(.*?\)/g,"") 不保留括号str.replace(/\(.*?\)/g,"()") 保留括号