# Searching list of words not working on pdf viewer

**URL:** <https://pdfjs.community/t/searching-list-of-words-not-working-on-pdf-viewer/381>\
**Category:** Technical Support\
**Created:** [November 4, 2020, 6:40am UTC](https://pdfjs.community/t/searching-list-of-words-not-working-on-pdf-viewer/381 "2020-11-04T06:40:49Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Logan](https://yyz1.discourse-cdn.com/flex031/user_avatar/pdfjs.community/logan/32/13_2.png) [@Logan](https://pdfjs.community/u/Logan)\
**Post date:** [November 4, 2020, 5:18pm UTC](https://pdfjs.community/t/searching-list-of-words-not-working-on-pdf-viewer/381/2 "2020-11-04T17:18:02Z")

</div>

Hey there!

Sorry, I should have been a bit more specific in my last comment.

You’ll probably want to do something like this:

```javascript
let arr = [‘RAS’, ‘Cable’, ‘92780’]
var regexFromMyArray = arr.join("|");

instance.docViewer.setSearchHighlightColors({
   searchResult: ‘rgba(0, 255, 0, 0.5)’,
   activeSearchResult: ‘rgba(0, 255, 0, 0.5)’
});
instance.searchTextFull(regexFromMyArray, { regex: true })

```

The things I changed here was using `searchTextFull` instead of just `searchText`, and using a string representation of the regex rather than an actual regex.

I hope this helps!

Thanks,  
Logan

---

_[View the full topic](https://pdfjs.community/t/searching-list-of-words-not-working-on-pdf-viewer/381)._
