{"id":37024603,"url":"https://github.com/wolfendale/scalacheck-gen-regexp","last_synced_at":"2026-01-14T02:58:51.894Z","repository":{"id":57735227,"uuid":"117332303","full_name":"wolfendale/scalacheck-gen-regexp","owner":"wolfendale","description":"A library for creating Scalacheck generators from regular expressions","archived":false,"fork":false,"pushed_at":"2022-12-03T10:54:27.000Z","size":43,"stargazers_count":22,"open_issues_count":2,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2023-08-03T02:56:03.023Z","etag":null,"topics":["property-testing","regexp","scalacheck"],"latest_commit_sha":null,"homepage":null,"language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wolfendale.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-13T09:48:35.000Z","updated_at":"2023-08-02T00:10:29.000Z","dependencies_parsed_at":"2023-01-23T19:01:21.310Z","dependency_job_id":null,"html_url":"https://github.com/wolfendale/scalacheck-gen-regexp","commit_stats":null,"previous_names":[],"tags_count":6,"template":null,"template_full_name":null,"purl":"pkg:github/wolfendale/scalacheck-gen-regexp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wolfendale%2Fscalacheck-gen-regexp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wolfendale%2Fscalacheck-gen-regexp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wolfendale%2Fscalacheck-gen-regexp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wolfendale%2Fscalacheck-gen-regexp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wolfendale","download_url":"https://codeload.github.com/wolfendale/scalacheck-gen-regexp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wolfendale%2Fscalacheck-gen-regexp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408799,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T01:52:23.358Z","status":"online","status_checked_at":"2026-01-14T02:00:06.678Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["property-testing","regexp","scalacheck"],"created_at":"2026-01-14T02:58:51.301Z","updated_at":"2026-01-14T02:58:51.869Z","avatar_url":"https://github.com/wolfendale.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# scalacheck-gen-regexp\n\nA library for creating [scalacheck](https://www.scalacheck.org/) generators from regular expressions\n\nCross-built for Scala 2.12/2.13/3.1/3.2\n\n##### Installation\n\nIn your `build.sbt`\n```scala\nlibraryDependencies += \"io.github.wolfendale\" %% \"scalacheck-gen-regexp\" % \"[VERSION]\"\n```\n\n##### Quick start\n\n```scala\nimport wolfendale.scalacheck.regexp.RegexpGen\n\nval generator: Gen[String] = RegexpGen.from(\"[1-9]\\\\d?(,\\\\d{3})+\")\n```\n\n##### Supported syntax\n\n| Feature           | Example                                     | Notes                                                                        |\n|-------------------|---------------------------------------------|------------------------------------------------------------------------------|\n| Literals          | `a`, `\\\\w`, `7`                             | Literals are transformed into constant generators                            |\n| Character Classes | `[abc]`, `[^abc]`, `[a-zA-Z0-9]`            | Character classes are transformed with `Gen.oneOf`                           |\n| Default Classes   | `\\w`, `\\d`, `\\S`, `.`                       | These are treated as predefined character classes                            |\n| Quantifiers       | `a?`, `b+`, `c*`, `d{3}`, `e{4,5}`, `f{5,}` | These use `Gen.listOfN` to create sized lists of the preceding term          |\n| Groups            | `(abc)`, `(?:def)`                          | Backreferences are not supported, groups can only be used for grouping terms |\n| Alternates        | `a\\|b\\|c`, `a(b\\|c)d`                             | Alternates are also transformed with `Gen.oneOf`                             |\n| Boundaries        | `^`, `$`, `\\b`                              | Although these will be parsed they do not modify the generator output        |\n\n##### Unsupported syntax\n\n| Feature                        | Example                     | Notes                                                                                                              |\n|--------------------------------|-----------------------------|--------------------------------------------------------------------------------------------------------------------|\n| Backreferences                 | `([ab]\\1)`                  | With the current implementation there's no simple way to do this, definitely in consideration for a future release |\n| Octal / Hex / Special Literals | `\\012`, `\\xF1`, `\\p{Lower}` | Most of these should be simple to implement but I wanted to get an initial release created first                   |\n| Character Class Intersection   | `[a\u0026\u0026[b]]`, `[a[b]]`        | Difficult to implement currently but not impossible, definite consideration for a future release                   |\n\n##### Tips for usage\n\n* In order to represent _any character_, `RegexpGen#from` takes an implicit `Arbitrary[Char]`.\nThere is a default instance provided by scalacheck however for most uses you probably want to\nprovide your own.\n\n* If you use the `+` or `*` quantifiers you'll end up getting huge variance in string sizes.\nIf this isn't what you want, consider bounding the lengths of certain string segments with the\n`{min,max}` quantifier.\n\n* Negated character classes / default classes are implemented by generating an arbitrary `Char`\nwithin certain bounds via `suchThat`, because of this you can end up throwing away a lot of \ncases and in certain circumstances your tests may fail. Try to refactor out negative cases.\n\n* In character classes each option is given equal weighting. If you'd prefer to weight a\nparticular entry you can add it multiple times, this is made easier with string interpolation:\n```s\"[${\"a-z\"*5}\\s]\"```. In the example case the generator is 5 times more likely to generate\nan alpha character than a space.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwolfendale%2Fscalacheck-gen-regexp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwolfendale%2Fscalacheck-gen-regexp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwolfendale%2Fscalacheck-gen-regexp/lists"}