4 Replies Latest reply on Mar 9, 2013 2:17 AM by designmon79

    use Regex to highlight word

    designmon79

      Hi,

       

      I have found following script in this forum. I need to modify this script so that it can find and highlight only page and pages following any digit (page 1, page 2 and pages 2-4 etc.).

      How can we use regular expression (regex) in this code? Please help.

          

      for (var k = 0; k < numpages; k++) {

       

          var numWords = this.getPageNumWords(k);

          var count = 0;

       

          for (var i = 0; i < numWords; i++) {

              var ckWord = this.getPageNthWord(k, i, true);

              var q = this.getPageNthWordQuads(k, i);

              if (ckWord === "Page") {

                  count++;

              }

          }

       

         ;

       

      }

       

       

      Thanks,

       

      Mon