4 Replies Latest reply on Jul 6, 2012 1:43 AM by greenrookie

    change filename using GREP

    greenrookie Level 2

      Hello,

       

      I'm trying to get these lines of code to change the filename when saving;

       

      from: zAlcatraz

      to: HAlcatraz

       

      if(myDocName.indexOf("z")!=-1){

      var myRegularExpression = /\\<z/gi

      myDocName = myDocName.replace(myRegularExpression, "H");

      }

       

      I'm trying to target just the first z at the front of every filename but can't get the grep correct.

       

      Any thoughts?

       

      Thanks in advance,

       

      GR