{"id":13593290,"url":"https://github.com/zhztheplayer/DFA-Regex","last_synced_at":"2025-04-09T02:33:06.379Z","repository":{"id":32014497,"uuid":"35585619","full_name":"zhztheplayer/DFA-Regex","owner":"zhztheplayer","description":"A DFA regex engine in java.","archived":false,"fork":false,"pushed_at":"2025-01-09T04:13:19.000Z","size":56,"stargazers_count":59,"open_issues_count":2,"forks_count":18,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-02T13:54:30.493Z","etag":null,"topics":["dfa-regex","java","redos","regex"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zhztheplayer.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}},"created_at":"2015-05-14T02:13:18.000Z","updated_at":"2025-01-30T04:39:08.000Z","dependencies_parsed_at":"2024-11-06T14:38:21.721Z","dependency_job_id":"372ace67-1f4e-45dd-99c5-23f4f9170294","html_url":"https://github.com/zhztheplayer/DFA-Regex","commit_stats":{"total_commits":22,"total_committers":2,"mean_commits":11.0,"dds":"0.18181818181818177","last_synced_commit":"a1b8992bc9785bdd6845c6dc6b86e4d06952cb36"},"previous_names":["zbdzzg/dfa-regex"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhztheplayer%2FDFA-Regex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhztheplayer%2FDFA-Regex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhztheplayer%2FDFA-Regex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhztheplayer%2FDFA-Regex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zhztheplayer","download_url":"https://codeload.github.com/zhztheplayer/DFA-Regex/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247965767,"owners_count":21025433,"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":["dfa-regex","java","redos","regex"],"created_at":"2024-08-01T16:01:18.832Z","updated_at":"2025-04-09T02:33:01.354Z","avatar_url":"https://github.com/zhztheplayer.png","language":"Java","funding_links":[],"categories":["Java"],"sub_categories":[],"readme":"# DFA-Regex ![](https://travis-ci.org/zhztheplayer/DFA-Regex.svg?branch=master)\n\nA DFA regex engine in java.\n\n### Pom Settings\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003etop.yatt.dfargx\u003c/groupId\u003e\n    \u003cartifactId\u003edfargx\u003c/artifactId\u003e\n    \u003cversion\u003e0.2.1\u003c/version\u003e\n\u003c/dependency\u003e\n```\n### Introduction\n\nThis is a Java DFA regex engine implementation.\n\n- High compatibility -- single jar lib, without 3rd dependencies\n- High performance -- O(n) liner time complex, can be used for avoiding [ReDoS](https://en.wikipedia.org/wiki/ReDoS)\n\n### Use Case\n```java\nRegexMatcher matcher = new RegexMatcher(\"\\\\d{1,3}\\\\.\\\\d{1,3}\\\\.\\\\d{1,3}\\\\.\\\\d{1,3}\");\nboolean result = matcher.match(\"192.168.0.255\"); // return true or false, should be true in this case.\n```\n### Performance Comparison With JDK Regex:\n\nBelow is showing a typical [ReDoS](https://en.wikipedia.org/wiki/ReDoS) attack input against a fragile regex pattern.\n\nRegex | Input | Time Cost (Java Native) | Time Cost (DFA Regex)\n:-----:|:------:|:-------------------------:|:------------:\n(a\\*)\\*|aaaaaaaaaaaaaaaaab|42ms|12ms\n(a\\*)\\*|aaaaaaaaaaaaaaaaaaaaaaab|311ms|1ms\n(a\\*)\\*|aaaaaaaaaaaaaaaaaaaaaaaaaaaab|9579ms|1ms\n\n### Supported Features:\n- matching\n- searching\n- ascii character set\n- `*`, `+`, `?`, `{x}`, `{x,y}`, `{x}`\n- `.`, `\\w`, `\\W`, `\\s`, `\\S`, `\\d`, `\\D`\n- complementary set `[^a]`\n- escape characters\n- brackets\n\n### Todo List:\n- [POSIX-Extended Regex](http://www.boost.org/doc/libs/1_44_0/libs/regex/doc/html/boost_regex/syntax/basic_extended.html) syntax support\n- Liner time searching","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhztheplayer%2FDFA-Regex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzhztheplayer%2FDFA-Regex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhztheplayer%2FDFA-Regex/lists"}