---
url: >-
  https://adk.nht.io/api/@nhtio/adk/batteries/tools/string_processing/variables/stringExtractTool.md
description: Extract all matches of a regular expression from a string.
---

# Variable: stringExtractTool

```ts
const stringExtractTool: Tool<SpooledArtifact>;
```

Defined in: [batteries/tools/string\_processing/index.ts:198](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/batteries/tools/string_processing/index.ts#L198)

Extract all matches of a regular expression from a string.

## Remarks

The `g` flag is always enabled. `group` selects which capture group to return per match (0 =
full match). Output is at most 500 matches; if truncated, the suffix `(truncated at 500)` is
appended.
