{"id":13621980,"url":"https://github.com/mifmif/Generex","last_synced_at":"2025-04-15T05:32:55.246Z","repository":{"id":18429139,"uuid":"21612407","full_name":"mifmif/Generex","owner":"mifmif","description":"A Java library for generating String from a regular expression.","archived":false,"fork":false,"pushed_at":"2021-04-28T14:47:43.000Z","size":236,"stargazers_count":377,"open_issues_count":19,"forks_count":74,"subscribers_count":28,"default_branch":"master","last_synced_at":"2024-11-17T12:56:26.088Z","etag":null,"topics":["java","regex","regular-expression","string-generator"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mifmif.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-07-08T12:49:38.000Z","updated_at":"2024-11-02T00:18:21.000Z","dependencies_parsed_at":"2022-09-02T07:02:22.422Z","dependency_job_id":null,"html_url":"https://github.com/mifmif/Generex","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mifmif%2FGenerex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mifmif%2FGenerex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mifmif%2FGenerex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mifmif%2FGenerex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mifmif","download_url":"https://codeload.github.com/mifmif/Generex/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249015950,"owners_count":21198824,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["java","regex","regular-expression","string-generator"],"created_at":"2024-08-01T21:01:12.636Z","updated_at":"2025-04-15T05:32:54.994Z","avatar_url":"https://github.com/mifmif.png","language":"Java","funding_links":[],"categories":["Java"],"sub_categories":[],"readme":"Generex\n=======\nA Java library for generating String that match  a given regular expression. it help you generate all Strings that matches a given Regex, random one , or one String from the matched String based on it's index.\nGenerex is based on the library http://www.brics.dk/~amoeller/automaton/.\n\n[![Build Status](https://travis-ci.org/mifmif/Generex.png)](https://travis-ci.org/mifmif/Generex)\n\n\n**Features :**\n-\n\n-Generate Random String that match the Regex.\n\n-Specify the min/max length  of the random generated String.\n\n-Generate a list of all Strings that matches the Regex, if the number of String that matches the Regex is greater then Integer.MAX_VALUE , the returned list will contains Strings up to the size limit of java.util.List which is Integer.MAX_VALUE (see iterator's feature in this case). \n\n-generate a sublist of the Strings that matches the Regex based on the lexicographical order.\n\n-Given an index 'n' , generate the n'th element in lexicographical order of the list of Strings that matches the Regex.\n\n-Prepare an iterator that loop over all the Strings that matches the Regex. even if the set of String that matches the given Regex is infinite.\n \n\n**How to use it :**\n-\n\nIf you use [Maven](http://maven.apache.org) you can include this library to your project by adding the following dependency: \n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.github.mifmif\u003c/groupId\u003e\n  \u003cartifactId\u003egenerex\u003c/artifactId\u003e\n  \u003cversion\u003e1.0.2\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nThe list of all available versions can be found at [Maven Central](http://search.maven.org/#browse|588844112).\n\nHere is the sample Java code demonstrating library usage:\n```java\n\n\n\t\tGenerex generex = new Generex(\"[0-3]([a-c]|[e-g]{1,2})\");\n\n\t\t// Generate random String\n\t\tString randomStr = generex.random();\n\t\tSystem.out.println(randomStr);// a random value from the previous String list\n\n\t\t// generate the second String in lexicographical order that match the given Regex.\n\t\tString secondString = generex.getMatchedString(2);\n\t\tSystem.out.println(secondString);// it print '0b'\n\n\t\t// Generate all String that matches the given Regex.\n\t\tList\u003cString\u003e matchedStrs = generex.getAllMatchedStrings();\n\n\t\t// Using Generex iterator\n\t\tIterator iterator = generex.iterator();\n\t\twhile (iterator.hasNext()) {\n\t\t\tSystem.out.print(iterator.next() + \" \");\n\t\t}\n\t\t// it prints:\n\t\t// 0a 0b 0c 0e 0ee 0ef 0eg 0f 0fe 0ff 0fg 0g 0ge 0gf 0gg\n\t\t// 1a 1b 1c 1e 1ee 1ef 1eg 1f 1fe 1ff 1fg 1g 1ge 1gf 1gg\n\t\t// 2a 2b 2c 2e 2ee 2ef 2eg 2f 2fe 2ff 2fg 2g 2ge 2gf 2gg\n\t\t// 3a 3b 3c 3e 3ee 3ef 3eg 3f 3fe 3ff 3fg 3g 3ge 3gf 3gg\n\t\t\n```\n\n**License**\n-\n\nGenerex is licensed under the Apache License, Version 2.0.  \nhttp://www.apache.org/licenses/LICENSE-2.0\n\n\n \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmifmif%2FGenerex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmifmif%2FGenerex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmifmif%2FGenerex/lists"}