{"id":23080651,"url":"https://github.com/chen0040/java-regex-cultivator","last_synced_at":"2025-07-26T04:32:34.453Z","repository":{"id":85884473,"uuid":"95016674","full_name":"chen0040/java-regex-cultivator","owner":"chen0040","description":"Regex generator which use genetic programming evolve grok and and to automatically discover regex given a set of texts having similar structure ","archived":false,"fork":false,"pushed_at":"2017-06-23T08:17:03.000Z","size":75,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-27T16:50:55.110Z","etag":null,"topics":["evolutionary-computation","expression-generator","genetic-programming","grok","regex"],"latest_commit_sha":null,"homepage":"","language":"Java","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/chen0040.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-06-21T15:06:07.000Z","updated_at":"2021-07-20T10:08:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"f2733fc0-4ae9-4003-974a-2c044958b3a3","html_url":"https://github.com/chen0040/java-regex-cultivator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/chen0040/java-regex-cultivator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chen0040%2Fjava-regex-cultivator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chen0040%2Fjava-regex-cultivator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chen0040%2Fjava-regex-cultivator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chen0040%2Fjava-regex-cultivator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chen0040","download_url":"https://codeload.github.com/chen0040/java-regex-cultivator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chen0040%2Fjava-regex-cultivator/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267117250,"owners_count":24038640,"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","status":"online","status_checked_at":"2025-07-26T02:00:08.937Z","response_time":62,"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":["evolutionary-computation","expression-generator","genetic-programming","grok","regex"],"created_at":"2024-12-16T13:15:54.359Z","updated_at":"2025-07-26T04:32:34.444Z","avatar_url":"https://github.com/chen0040.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# java-regex-cultivator\nRegex generator which use genetic programming to evolve grok and automatically discover regex given a set of texts having similar structure.\n\n\n# Install\n\nAdd the following dependency to your POM file:\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.github.chen0040\u003c/groupId\u003e\n  \u003cartifactId\u003ejava-regex-cultivator\u003c/artifactId\u003e\n  \u003cversion\u003e1.0.1\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n# Usage\n\nThe sample code below shows how the gp regex cultivator discover the regex for the message \"\":\n\n```java\nGpCultivator generator = new GpCultivator();\n      generator.setDisplayEvery(2);\n      generator.setPopulationSize(1000);\n      generator.setMaxGenerations(50);\n\nList\u003cString\u003e trainingData = new ArrayList\u003c\u003e();\ntrainingData.add(\"user root login at 127.0.0.1\");\nGrok generated_grok = generator.fit(trainingData); // this is the grok interpreter generated\n\nSystem.out.println(\"user root login at 127.0.0.1\");\nSystem.out.println(generator.getRegex()); // this is the regex generated\n\n\nMatch matched = generated_grok.match(\"user root login at 127.0.0.1\");\nmatched.captures();\nSystem.out.println(matched.toJson());\n```\n\nBelow is the print out from the sample code above:\n\n```bash\n...\nGeneration: 4 (Pop: 1000), elapsed: 3 seconds\nGlobal Cost: 0.2\tCurrent Cost: 0.2\n...\nGlobal Cost: 0.14285714285714285\tCurrent Cost: 0.16666666666666666\nuser root login at 127.0.0.1\n%{LOGLEVEL} %{USER} %{URIPROTO} %{URIHOST} %{IPV4}\n{\"IPORHOST\":\"at\",\"IPV4\":\"127.0.0.1\",\"LOGLEVEL\":\"er\",\"URIHOST\":\"at\",\"URIPROTO\":\"login\",\"USER\":\"root\"}\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchen0040%2Fjava-regex-cultivator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchen0040%2Fjava-regex-cultivator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchen0040%2Fjava-regex-cultivator/lists"}