ucOperationControl_FormView1_dgDtl_ctl04_FtBudgetMoney中想把_ctl04_中的04替换成比如aaa怎么用js正则写出来?
在线等,分给一人谢谢!

解决方案 »

  1.   

    var str="ucOperationControl_FormView1_dgDtl_ctl04_FtBudgetMoney";
         str=str.replace(/04/,"aaa");
      

  2.   

    ....._ctl04_中的04,可能还是其他数值.
      

  3.   

    var str="ucOperationControl_FormView1_dgDtl_ctl04_FtBudgetMoney";
         str=str.replace(/_ctl(04)/,"$1","aaa");
      

  4.   

    str=str.replace(/_ctl(04)/,"$1","aaa");
    好像不行哦,我试了下.
      

  5.   

    try:
     var str="ucOperationControl_FormView1_dgDtl_ctl04_FtBudgetMoney";
     str=str.replace(/_ctl\d+/,"_ctlaaa");
      

  6.   

    var str="ucOperationControl_FormView1_dgDtl_ctl04_FtBudgetMoney";
         str=str.replace(/_ctl04_/,"_ctlaaa_");