{"id":18450251,"url":"https://github.com/libsteve/reggie-the-regex-parser","last_synced_at":"2025-07-22T05:04:10.660Z","repository":{"id":4950839,"uuid":"6108171","full_name":"libsteve/Reggie-the-Regex-Parser","owner":"libsteve","description":"A attempt to learn C and Automata Theory at the same time. Reggie is an attempt to create an executable NFA structure, in hopes that it can be used to power a regular expression evaluator.","archived":false,"fork":false,"pushed_at":"2014-02-22T18:52:49.000Z","size":613,"stargazers_count":5,"open_issues_count":5,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-08T01:35:01.322Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","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/libsteve.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":"2012-10-07T00:43:21.000Z","updated_at":"2018-10-18T21:47:22.000Z","dependencies_parsed_at":"2022-08-18T02:45:25.218Z","dependency_job_id":null,"html_url":"https://github.com/libsteve/Reggie-the-Regex-Parser","commit_stats":null,"previous_names":["libsteve/reggie-the-regex-parser"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/libsteve/Reggie-the-Regex-Parser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libsteve%2FReggie-the-Regex-Parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libsteve%2FReggie-the-Regex-Parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libsteve%2FReggie-the-Regex-Parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libsteve%2FReggie-the-Regex-Parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/libsteve","download_url":"https://codeload.github.com/libsteve/Reggie-the-Regex-Parser/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libsteve%2FReggie-the-Regex-Parser/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266430671,"owners_count":23927166,"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-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":[],"created_at":"2024-11-06T07:24:08.222Z","updated_at":"2025-07-22T05:04:10.633Z","avatar_url":"https://github.com/libsteve.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"Reggie the Regex Parser\n=======================\n\nReggie the Regex Parser (RRP) is a regualr expression parser that will have the ability to identify strings that match the regular expression.\n\nPurpose\n-------\n\nTo learn about and understand regualr expressions and finite automata.\n\nTo write awesome things in the C language.\n\nTo become a badass and super-being among mortals.\n\nTo create the foundations for a regex parser for possible future use in attempts at creating compilers.\n\nDesign\n------\n\nRegualr expressions are written forms of a non-deterministic finite automata (NFA), which represents a machine that matches strings of characters for patterns encoded within the machine.\n\nAn NFA is a directed graph with one initial node state (known as \"q0\") and any number of other states. Any number of states within the NFA can be an accepting state that would signify the acceptance of a string when the string encounters its end. Transitions between states are invoked by encountering specified characters. [Learn more about NFAs from Wikipedia](http://en.wikipedia.org/wiki/Nondeterministic_finite_automaton).\n\nThis regex parser will take a regualr expression string and create an NFA modeled by that string.\n\nA user can then take the resulting NFA and pass in a string to see if it passes the NFA.\n\nNFAs for Use with Parsing\n-------------------------\n\nA strict NFA would not be useful for parsing purposes. If you wanted to tokenize using an NFA, you would need to know how long the string that is accepted by the NFA is, and you would need to be able to deal with anything following the final accept terminal state.\n\nA parsing evaluator needs to be implemented to allow for the length of any accepting substring in an input string, so long as the substring and the input string start together.\n\nNFA Copying\n-----------\n\nThe recursive structure of an NFA makes cloning and copying less than arbitrary. A template representing a blueprint for the NFA is created, and then an NFA structure is built from the generated template.\n\nThe template is a map of state pointers to state representations, and from transition pointers to transition representations.\n\nPublic Interface\n----------------\n\nThe `reggie.h` file reveals the public interface for the regex parser. This file includes function definitions that facilitate the creation, destruction, use for matching, use for parsing, and manipulation of regualr expressions backed by NFAs.\n\nPossible Future Exploations\n---------------------------\n\nThe use of a modified Non-Deterministic Push-Down Automata (PDA) may be useful for implementing a regular-expression parsing machine that could also be used outside the regex parsing to become a general-purpose parser.\n\nSource Highlights\n-----------------\n\n`list.h` is a mean C Linked-List Library featuring a `FOREACH` macro looping construct and more.\n\n`map.h` is a map or dictionary implementation based on the `list.h` library allowing for primative key-value storying of any pointer data values.\n\n`nfa.h` holds the structure of the Non-Deterministic Finite Automata and it's parts.\n\nCompilation\n-----------\n\nTo compile and run tests, run\n\n\tmake test\n\nTo clean the build files, run\n\n\tmake clean\n\nTo clean the build files and binaries, run\n\n\tmake real-clean\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibsteve%2Freggie-the-regex-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flibsteve%2Freggie-the-regex-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibsteve%2Freggie-the-regex-parser/lists"}