2 Replies Latest reply on Dec 11, 2012 1:56 PM by Jo_2005

    Wild Card Characters in string for NthWord

    Jo_2005 Level 1

      I have a script which will search through pages to see if the 70th word on each page is equal to a number code.


      This number is unique for each occurence: eg  1090089, 10704591 but will always begin with the number one.


      I am having trouble coming up with a javascript expression for a wild card search to call up the number, the rest of the script  is ok.


      Can any one please offer some assistance with the wild card search part of the script to work correctly??



      var numpages = this.numPages;

      for (var k=0; k < numpages; k++)
      var numWords = this.getPageNumWords(k);
      for (var i=0; i<numWords; i++)
      var ckWord = this.getPageNthWord(k, i, true);

      var q = this.getPageNthWordQuads(k, i);
      // Convert quads in default user space to rotated
      // User space used by Links.
      m = (new Matrix2D).fromRotated(this,0);
      mInv = m.invert()
      r = mInv.transform(q)
      r = r.split(",");

      if (ckWord == "1" + /d\d\d\d\d\d\/ && i == 70))
      console.println("Code number is on " + "Page " + (k+1));