Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6753889
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:12:56+00:00 2026-05-26T13:12:56+00:00

In Adobe Acrobat 9, how do I apply a regex to search the text

  • 0

In Adobe Acrobat 9, how do I apply a regex to search the text of a pdf and/or index of a series of pdfs?

There are 200 or so keywords that I need to search, and I could do it manually through each index, but I’ll have to do this several times for a lot of indexs/pdfs and want to automate as much as possible.

It’s easy enough to search the text of a pdf from the JavaScript console, say for the word ‘the’:

search.query("the","ActiveDoc");

And having a regex interact with a string you’ve written in the console is no problem either:

var string="I hope this works9867"
var regex=/\d/

if (regex.test(string))
    {app.alert("win",2)
    }

But I can’t get a regex to apply to the OCR-ed text of a pdf and have found no guides on how to do so thus far. It seemed logical that either

var regex=/\d/

search.query(regex,"ActiveDoc");

or some close variant on

search.query(/\d/,"ActiveDoc");

would work, but no dice. Is there a way to do this? Ideally the method would work for indexes and pdfs alike.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T13:12:57+00:00Added an answer on May 26, 2026 at 1:12 pm

    You cant use regular expressions with search.query.
    There are two ways you can make searching easier:

    Method #1: Put everything you want to search for in an array and pass that to search.query.

    myArray = “stuff you want to search for”;
    search.query(myArray, “ActiveDoc”);

    You could also change the way you want to search by doing something like this:

    search.wordMatching = “BooleanQuery”;
    search.matchWholeWord = false;
    myArray = “Word1 OR Word2 OR Word3”;
    search.query(myArray, “Folder”, “/c/myDocuments”);

    For more examples of how to configure search.query, refer to the Adobe Javascript API Reference.

    Method #2: Extract the text out of the PDF document and perform a regex search on the string.
    The following code loops through the entire document and makes a string of the words on each page and then searches for “Hello” inside the string.

    for (var i = 0; i < this.numPages; i++) { // Loop through the entire document
        numWords = this.getPageNumWords(i); // Find out how many words are on the page
        var WordString = ""; // Prepare a string
        for (var j = 0; j < numWords; j++) // Put all the words on the page into a string
        {
            WordString = WordString + " " + this.getPageNthWord(i, j);
        }
        if (WordString.match(/Hello/)) { // Search for the word "Hello" in the string
            search.matchWholeWord = true; // If we got here, we'll search for "Hello" in the document
            search.query(WordString.match(/Hello/), "ActiveDoc");
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know that forms in .pdf made by Adobe Acrobat can act like questionnaire
code: <span>Upload Adobe Acrobat file<img src=../../Images/UI/pdf.jpg style=height: 25; width: 20 height=25 width=20 /></span> <asp:FileUpload
Let's say I have two PDF templates created with Adobe Acrobat, which are both
E.g. When you download pdf on the browser (PC) hit starts the Adobe acrobat..similarly...can
In Adobe Acrobat Pro, it's not that difficult to add links to a page,
Sometimes when I secure a PDF document in Adobe Acrobat (9), other people using
I'm looking for a full text search algorithm that will allow to find similar
The Adobe docs (I can't find which) state that Flash can read Shared Objects
I recently used Adobe Acrobat Pro's OCR feature to process a Japanese kanji dictionary.
I've been using Delphi and the Adobe Acrobat 9 API. I'm simply opening a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.