Try to use something like this, but can delete the text.Please give your suggestions...
// Define Regular Expression for search
var rgExp = /Dan/;
// Loop over document pages
// do something