# Text control characters find

`text-control-characters-find` · version 1.0.0 · Text · free, no key needed

Find non-whitespace control characters in a text string.

**Use when you need to: text control characters find · find control characters · detect non-printable characters.**

## Supported

- text control characters find
- find control characters
- detect non-printable characters

## Not supported

- remove control characters
- check whitespace
- read files

## Behavior

- Control characters are defined as Unicode code points in the ranges U+0000-U+001F and U+007F-U+009F.
- Standard whitespace control characters (U+0009 Tab, U+000A LF, U+000D CR) are ignored.
- Returns up to 1000 matches, containing the 0-based UTF-16 code unit offset (index) and the code point as a hex string (e.g., "U+001B").
- Note: index represents the UTF-16 code unit offset in JavaScript strings, which may diverge from code point offset in strings containing astral characters/surrogate pairs.

## Input

- `text` (string, required): max length 1048576

## Output

- `matches` (array of object, required)

## Limits

- max text bytes: 1048576

## Example

Request input:

```json
{
  "text": "hello\u001bworld\u0000"
}
```

Response:

```json
{
  "result": {
    "matches": [
      {
        "index": 5,
        "code_point": "U+001B"
      },
      {
        "index": 11,
        "code_point": "U+0000"
      }
    ]
  }
}
```

## How to call it

### MCP

Connect `https://computefirst.net/mcp` ([setup](/docs#connect)), then call `execute` with:

```json
{
  "id": "text-control-characters-find",
  "version": "1.0.0",
  "input": {
    "text": "hello\u001bworld\u0000"
  }
}
```

### HTTP (no key)

```sh
curl -X POST https://computefirst.net/v1/tools/text-control-characters-find/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"text":"hello\u001bworld\u0000"}'
```

The machine-readable contract is at [/v1/tools/text-control-characters-find/versions/1.0.0](/v1/tools/text-control-characters-find/versions/1.0.0).

### CLI

```sh
node cli.mjs run text-control-characters-find 1.0.0 --input input.json --base-url https://computefirst.net
```

Get the client at [/clients/cli/](/clients/cli/).

## Related tools

- [Text indentation detect](/tools/text-indentation-detect): Detect whether a text uses tabs or spaces for indentation by counting lines.
- [Text apply unified patch](/tools/text-apply-unified-patch): Apply a one-file unified patch to text at original line addresses with exact hunk matches.
- [Text conflict parse](/tools/text-conflict-parse): Parse merge or diff3 conflict-marker text into ordered text and conflict parts.
- [Text conflict render](/tools/text-conflict-render): Render text and conflict parts as merge or diff3 conflict-marker text.
- [Text count](/tools/text-count): Count Unicode code points, UTF-16 code units, UTF-8 bytes, and lines.
- [Text diff stats](/tools/text-diff-stats): Summarize a line-record diff as keep, insert, delete, and hunk counts.
