# DocTextFinder Class

> A class used to extract words from a document using a regular expression.

- Product: Adobe PDF Library 21
- Language: Modern C++
- Version: 21.4.0
- HTML page: https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/DocTextFinder
- Version index: https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/llms.txt

```cpp
class DocTextFinder
```

**Namespace:** `datalogics_interface`

## Description

A class used to extract words from a document using a regular expression.

**Uses types:** [`DocTextFinderMatch`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/DocTextFinderMatch.md)

## Constructors

### DocTextFinder

```cpp
datalogics_interface::DocTextFinder::DocTextFinder(DocTextFinder &&) noexcept
```

*constructor*

**Parameters**

- (unnamed) ([`DocTextFinder &&`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/DocTextFinder.md))

### DocTextFinder

```cpp
datalogics_interface::DocTextFinder::DocTextFinder(Document &doc)
```

*constructor*

**Parameters**

- `doc` ([`Document &`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/Document.md)): The document to search.

Create a DocTextFinder for the given document.

### DocTextFinder

```cpp
datalogics_interface::DocTextFinder::DocTextFinder(Document &doc, WordFinderConfig &config)
```

*constructor*

**Parameters**

- `doc` ([`Document &`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/Document.md)): The document to search.
- `config` ([`WordFinderConfig &`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/WordFinderConfig.md)): Word finder configuration controlling text extraction behavior.

Create a DocTextFinder with a word-finder configuration.

### ~DocTextFinder

```cpp
datalogics_interface::DocTextFinder::~DocTextFinder()
```

*destructor*

## Methods

### get_match_list

```cpp
std::vector< DocTextFinderMatch > datalogics_interface::DocTextFinder::get_match_list(int begin_page, int end_page, const std::string &regex)
```

**Parameters**

- `begin_page` (`int`): the beginning page number included in the search.
- `end_page` (`int`): the ending page number included in the search.
- `regex` (`const std::string &`): the regular expression to use for the search.

**Returns:** [`std::vector< DocTextFinderMatch >`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/DocTextFinderMatch.md)

a structure containing matching phrases along with its quads.

Finds all matching strings for a given regular expression for the specified page range. It returns a vector containing words along with the page and matching phrase that was found.

### operator=

```cpp
DocTextFinder & datalogics_interface::DocTextFinder::operator=(DocTextFinder &&) noexcept
```

**Parameters**

- (unnamed) ([`DocTextFinder &&`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/DocTextFinder.md))

**Returns:** [`DocTextFinder &`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/DocTextFinder.md)
