Metadata-Version: 2.4
Name: smartgrex
Version: 0.2.2
Summary: Intelligent regex generator based on LCS, Trie and pattern analysis
Author: Nick
License: MIT
Keywords: regex,generator,trie,lcs
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# SmartGrex

Intelligent regex generator based on LCS, Trie and pattern analysis.

## Install

```
pip install smartgrex
```

## Usage

### CLI

```
smartgrex 13812345678 15987654321 --json
smartgrex user@a.com admin@test.org --json
smartgrex explain cat_1 cat_2
smartgrex --file samples.txt --json
```

### Python

```python
from smartgrex import RegexGenerator

rg = RegexGenerator()
print(rg.generate(["13812345678", "15987654321"]))
print(rg.explain(["user@a.com", "admin@test.org"]))
```

Given sample strings, SmartGrex detects a known pattern type (email,
phone, ipv4, number, url) common to all samples and returns a anchored
regex; otherwise it falls back to a common-prefix (Trie) based pattern.

## License

MIT
