Skip to main content
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"}



```

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)

Source distribution for perg 0.1.6
File Size Uploaded
perg-0.1.6.tar.gz 2.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for perg 0.1.6
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

0.1.6 This release

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

1 release file

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page