# perf\(ai-insights\): use a regex for the Ollama base control-character check \(\#441\) · lucenx/codexbar-plasma

[View on GitCafe](https://git.cafe/lucenx/codexbar-plasma/commit/2b70147e41f7d535618d085622ef5893b5cc88dc)

Repository: [lucenx/codexbar-plasma](https://git.cafe/lucenx/codexbar-plasma)

Visibility: public

Requested revision: 2b70147e41f7d535618d085622ef5893b5cc88dc

Requested commit: 2b70147e41f7d535618d085622ef5893b5cc88dc

Commit: 2b70147e41f7d535618d085622ef5893b5cc88dc

Tree: a1f077d2195aef718aa87ac0654978c6fd2cf10c

Author: Simone

Committer: GitHub

## Message

```
perf(ai-insights): use a regex for the Ollama base control-character check (#441)

Replace the any()/ord() generator in ollama_base() with re.search(r"[\x00-\x20\x7f]", value). It rejects exactly the same characters as before (U+0000-U+0020 and U+007F DEL) without a per-character Python loop.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
```

## Parents

- [697d2696593970648597e33d61a1e52ae6455ac7](https://git.cafe/lucenx/codexbar-plasma/commit/697d2696593970648597e33d61a1e52ae6455ac7?format=markdown)

[Source at this commit](https://git.cafe/lucenx/codexbar-plasma/tree/2b70147e41f7d535618d085622ef5893b5cc88dc?format=markdown)
