These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

How could I search certain text with regex?

gavin2u
Registered: Jul 3 2009
Posts: 76
Answered

Hi,

I wanna search a certain pattern using regex, and add an underline annotation to it.

But how could i search text using regex in javascript ?

thanks

-
gavin

My Product Information:
Acrobat Pro 9.0, Windows
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
You have to look word by word on each page of the PDF using the 'getPageNthWord(nPage, nWord, bStrip)' and the 'getPageNumWords(nPage), methods. There is an example in the JS API Refence that shows how to do this for a spelling check.

George Kaiser

gavin2u
Registered: Jul 3 2009
Posts: 76
gkaiseril wrote:
You have to look word by word on each page of the PDF using the 'getPageNthWord(nPage, nWord, bStrip)' and the 'getPageNumWords(nPage), methods. There is an example in the JS API Refence that shows how to do this for a spelling check.
thx gkaiseri, i am finally aware of that it is impossible to use regex directly in acrobat javascript.
Of course, I'd to use the methods you mentioned above, and now, I get a very near result. :)

thx

-
gavin