Skip to main content

Generate a stream of random samples from the set of strings matching a Perl regex

Project description

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"}



```

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

perg-0.1.4.tar.gz (3.3 kB view hashes)

Uploaded Source

Built Distribution

perg-0.1.4.linux-x86_64.tar.gz (5.7 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page