Regex Sampler
---
Simple commandline utility to generate samples uniformly over the space of strings matching a provided regular expression. Useful for spoofing input to programs!
## Example:
We can generate a stream of fake JSON data representing people and their emails!
```
$ ./perg.py '{ "name":"(\w+) (\w+)", "email": "\1_\2@\w+.(edu|com|org)"}'
{ "name":"R TWER", "email": "R_TWER@PVRcyR)com"}
{ "name":"mwGwTOWKRXs GIGY", "email": "mwGwTOWKRXs_GIGY@FvERutwS]org"}
{ "name":"igUMTrViMt oTkFPAySfn", "email": "igUMTrViMt_oTkFPAySfn@kQekedu"}
{ "name":"MtvMHGBi R", "email": "MtvMHGBi_R@UCPbGDjJai&com"}
{ "name":"fbMyddFkTRP QeH", "email": "fbMyddFkTRP_QeH@ekmjacom"}
{ "name":"vO devQkFbORdi", "email": "vO_devQkFbORdi@LaAPfnmMcnTZlYorg"}
{ "name":"khT BoWvCONzyeOYoNgasncZnU", "email": "khT_BoWvCONzyeOYoNgasncZnU@kV-com"}
{ "name":"TmEU TvjeB", "email": "TmEU_TvjeB@pMMnvdcom"}
{ "name":"rzjoN jkpSd", "email": "rzjoN_jkpSd@qTLvRUedu"}
{ "name":"pgzQ fz", "email": "pgzQ_fz@Shtedu"}
```
---
Simple commandline utility to generate samples uniformly over the space of strings matching a provided regular expression. Useful for spoofing input to programs!
## Example:
We can generate a stream of fake JSON data representing people and their emails!
```
$ ./perg.py '{ "name":"(\w+) (\w+)", "email": "\1_\2@\w+.(edu|com|org)"}'
{ "name":"R TWER", "email": "R_TWER@PVRcyR)com"}
{ "name":"mwGwTOWKRXs GIGY", "email": "mwGwTOWKRXs_GIGY@FvERutwS]org"}
{ "name":"igUMTrViMt oTkFPAySfn", "email": "igUMTrViMt_oTkFPAySfn@kQekedu"}
{ "name":"MtvMHGBi R", "email": "MtvMHGBi_R@UCPbGDjJai&com"}
{ "name":"fbMyddFkTRP QeH", "email": "fbMyddFkTRP_QeH@ekmjacom"}
{ "name":"vO devQkFbORdi", "email": "vO_devQkFbORdi@LaAPfnmMcnTZlYorg"}
{ "name":"khT BoWvCONzyeOYoNgasncZnU", "email": "khT_BoWvCONzyeOYoNgasncZnU@kV-com"}
{ "name":"TmEU TvjeB", "email": "TmEU_TvjeB@pMMnvdcom"}
{ "name":"rzjoN jkpSd", "email": "rzjoN_jkpSd@qTLvRUedu"}
{ "name":"pgzQ fz", "email": "pgzQ_fz@Shtedu"}
```
Release files for perg 0.1.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| perg-0.1.6.tar.gz | 2.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| perg-0.1.6.linux-x86_64.tar.gz | Details |
Total release size: 5.0 kB
Release files / perg-0.1.6.tar.gz
| Download URL | perg-0.1.6.tar.gz |
|---|---|
| Size | 2.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c6c5e84de61dc7f5eee21fb32516d71ea7f8dc985bb1447e1491a60517add481
|
|
BLAKE2b-256 checksum How to use checksums |
02459c7bf6b4bf2b74938725b89fd010f2acad305b7b4f3e4c198557bd8b134d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / perg-0.1.6.linux-x86_64.tar.gz
| Download URL | perg-0.1.6.linux-x86_64.tar.gz |
|---|---|
| Size | 2.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
10621d630176ccc7dcf6823dfebac451a5008eafbbf1987b8f48c708957982ef
|
|
BLAKE2b-256 checksum How to use checksums |
1a85ad6645193c2eb40458a7be80d1aee77a602f263fc6a146049fec8b176f87
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |