ex-regex
Python re-style library that finds, replaces, splits and extracts text by meaning, with Jev judging each candidate span.
Overview
ex-regex has the shape of Python's re module, but each match is decided by a model reading the text rather than a pattern checking its shape. You can redact a specific person's contact details but not a support address, filter tickets that actually ask for money back, or pull the total due rather than the subtotal. Every match is still a verbatim slice of the input with offsets, so a result can be wrong but never invented.
Finders propose candidate spans, and Jev judges each span with a yes/no question against your plain-English description. Up to 32 questions share one request and requests run eight at a time, so a 70-sentence document takes three requests. Jev can only pick spans a finder found, so it cannot alter digits or return values not in the input. An exgrep command can combine a regex prefilter with the model's decision. The README notes that wording the description well drives most of the accuracy, and that it supports explicit uncertainty and exact replay.
What the decision model decides
| Type | Question | Answers |
|---|---|---|
| Yes / no | Does this span match the description (e.g. a way to contact a specific person)? | yes · no |
How it works
- Finders propose candidate spans (sentences, contacts, amounts)
- Jev answers a yes/no question per span, batched
- Matching spans are returned with offsets
- sub/filter/extract act on the verbatim spans
Strengths
- Results are always verbatim input slices
- Familiar re-style API
- Batched requests keep cost down
- Regex prefilter supported
Caveats
- Pre-release package
- Accuracy depends heavily on description wording
- Text is sent to TypeSafe
Getting started
python -m pip install --pre ex-regex, set TYPESAFE_API_KEY, then ex.sub("a way to contact a specific person", "[redacted]", text, unit="contact").At a glance
- Type
- Demo
- Status
- beta
- Language
- Python
- Runtime
- library + CLI
- Has code
- yes
- Has tests
- yes
- License
- MIT
Use cases and integrations
How curated lists describe it
Match meaning in Python. Find, replace, extract, and compose semantic patterns with typed decisions, explicit uncertainty, and exact replay.
hellogumbo/awesome-jev
Frequently asked questions
Can it invent text?
No, every match is a verbatim slice of the input.
How does it differ from regex?
It matches by meaning: Jev judges each candidate span against your description.
How many requests does a document take?
Up to 32 spans share one request; a 70-sentence document is about three.
Related projects
Fills Japanese government PDF forms by asking Jev which profile item each unlabeled field is; personal values stay in the browser.
ServicebetaJavaScriptRecord linkage for researchers: write the match rule in plain English and Jev judges each candidate pair with a probability.
ProjectbetaPythonStreaming PII redaction library for TypeScript with 155 regex detectors, optional NER, and opt-in Jev confirmation before redacting names.
ProjectbetaTypeScriptEight zero-dependency examples applying Jev to mechanical and electrical engineering: CAD routing, FEM triage, DFM, BOM alignment.
ProjectprototypePythonLocal-first personal-data inventory tool with optional Jev classification per column, not per row, and dry-run payload review.
ProjectprototypePythonSmall dependency-free library that maps uploaded CSV columns to your schema with exact-name matching, then one Jev Noul per remaining pair.
ProjectprototypeJavaScript