A fast CLI tool written in Rust that generates minimal regex patterns for Path of Exile items. Given a list of target items (e.g., specific divination cards), diviner generates a PoE regex filter that matches exactly those items and no others.
- Smart Pattern Generation: Automatically finds the shortest unique substring patterns
- Description Text Search: Searches both item names and flavor text for unique patterns
- Fast Performance: Built in Rust for speed
- Caching: API responses cached locally (24h default) to avoid hammering poe.ninja
- Multiple Item Types: Support for divination cards, scarabs, essences, and more
- Error Handling: Graceful handling of typos and network errors
cargo build --releaseThe binary will be at target/release/diviner.
# Generate regex for specific divination cards
diviner -t div -i "The Doctor,The Nurse,The Apothecary"
# Using full flag names
diviner --item-type div --items "House of Mirrors,Seven Years Bad Luck"diviner --list-typesOutput:
Supported item types:
div → DivinationCard
scarab → Scarab
essence → Essence
fossil → Fossil
(and more...)
Create a file with one item per line:
# items.txt
The Doctor
The Nurse
House of MirrorsThen run:
diviner -t div -f items.txtdiviner -t div -i "The Doctor" --refreshdiviner -t div -i "The Doctor" --league Settlers| Flag | Long Form | Description | Default |
|---|---|---|---|
-t |
--item-type |
Item type (div, scarab, etc.) | required |
-i |
--items |
Comma-separated list of items | - |
-f |
--file |
Read items from file | - |
-l |
--league |
PoE league name | Standard |
-r |
--refresh |
Force cache refresh | false |
--list-types |
List all item types | - | |
--cache-dir |
Custom cache directory | ~/.cache/diviner |
|
--cache-duration |
Cache expiry in hours | 24 |
|
-h |
--help |
Show help | - |
-V |
--version |
Show version | - |
Diviner supports intelligent fuzzy matching for item names:
- Case-insensitive: Automatically handles uppercase/lowercase
- Partial names: "doctor" matches "The Doctor", "apoth" matches "The Apothecary"
- Typo correction: "doctorr" matches "The Doctor" using Levenshtein distance
- Word matching: Matches items by individual words
- Ambiguity detection: Warns when multiple items match with similar confidence
When fuzzy matching is used, the tool will show you what was matched and the confidence score.
$ diviner -t div -i "The Doctor,The Apothecary,House of Mirrors" -l Standard
✓ Loaded 453 items from cache
Found 3 of 3 items:
✓ The Doctor
✓ The Apothecary
✓ House of Mirrors
Generated regex:
doc " ap" hou
Copy this into your Path of Exile item filter.$ diviner -t div -i "doctor,nurse,apoth" -l Standard
✓ Loaded 453 items from cache
📝 Fuzzy matched 3 item(s):
'doctor' → 'The Doctor' (score: 92, substring match)
'nurse' → 'The Nurse' (score: 91, substring match)
'apoth' → 'The Apothecary' (score: 87, substring match)
✓ Found 3 of 3 items:
The Doctor
The Nurse
The Apothecary
Generated regex:
"(doc|nur| apo)"
Copy this into your Path of Exile item filter.$ diviner -t div -i "doctorr" -l Standard
✓ Loaded 453 items from cache
📝 Fuzzy matched 1 item(s):
'doctorr' → 'The Doctor' (score: 80, word match)
✓ Found 1 of 1 items:
The Doctor
Generated regex:
xam
Copy this into your Path of Exile item filter.$ diviner -t div -i "the" -l Standard
✓ Loaded 453 items from cache
⚠ Ambiguous match for 'the'. Did you mean one of these?
1. The Fox (score: 88, substring match)
2. The Sun (score: 88, substring match)
3. The Web (score: 88, substring match)
4. The Body (score: 87, substring match)
5. The Deal (score: 87, substring match)
✗ 1 item(s) not found:
the
Error: None of the requested items were found- Fetch Item Data: Downloads item list from poe.ninja API (or uses cache), including:
- Item name
- Flavor text (description)
- Explicit modifiers (e.g., divination card rewards)
- Implicit modifiers
- Find Unique Patterns: For each target item, finds the shortest substring that:
- Appears in the target item's searchable text (name + description + modifiers)
- Does NOT appear in any non-target items' searchable text
- Format Output: Combines patterns using PoE regex syntax:
- Single item: Returns pattern as-is (e.g.,
xam) - Multiple items: Returns
"(pattern1|pattern2|pattern3)"format - Deduplicates identical patterns
- Escapes special characters
- Single item: Returns pattern as-is (e.g.,
The generated regex uses PoE's built-in search syntax:
- Single pattern:
pattern(e.g.,xam) - Multiple patterns:
"(pattern1|pattern2|pattern3)"for OR logic - Case-insensitive matching by default in PoE
- The tool searches across item name, description, and modifiers (like div card rewards)
Example: "(doc| apo)" matches items containing "doc" OR " apo"
By default, cache files are stored in:
- Linux/macOS:
~/.cache/diviner/ - Windows:
%LOCALAPPDATA%\diviner\
Cache files are named: {league}_{itemtype}.json
✅ Basic CLI with flags ✅ poe.ninja API fetching ✅ Simple caching with expiry ✅ Regex generation (brute force substring search) ✅ Support for divination cards and all item types ✅ Error handling and validation
- Fuzzy matching for typos
- Pattern optimization (merge similar patterns)
- Interactive mode with fuzzy search
- Validate regex against known items
- Export to filter file format
reqwest- HTTP client for API callsclap- CLI argument parsingserde/serde_json- JSON serializationchrono- Date/time handlingdirs- Cross-platform directory pathsanyhow/thiserror- Error handlingshellexpand- Path expansion
MIT
Contributions welcome! Please ensure:
- Code passes
cargo test - Code passes
cargo clippy - Follow existing code style