{"id":18282560,"url":"https://github.com/rafael-santiago/here","last_synced_at":"2025-10-10T10:22:54.313Z","repository":{"id":21019151,"uuid":"24312394","full_name":"rafael-santiago/here","owner":"rafael-santiago","description":"A tiny C-library that implements regular expressions. ","archived":false,"fork":false,"pushed_at":"2022-05-30T11:50:35.000Z","size":41,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-09T05:29:40.282Z","etag":null,"topics":["c","minimalist-library","regular-expression"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"sirkut/DevHelper","license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rafael-santiago.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-09-22T03:09:49.000Z","updated_at":"2023-06-19T00:35:12.000Z","dependencies_parsed_at":"2022-09-01T23:30:57.725Z","dependency_job_id":null,"html_url":"https://github.com/rafael-santiago/here","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rafael-santiago/here","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafael-santiago%2Fhere","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafael-santiago%2Fhere/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafael-santiago%2Fhere/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafael-santiago%2Fhere/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rafael-santiago","download_url":"https://codeload.github.com/rafael-santiago/here/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafael-santiago%2Fhere/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279003529,"owners_count":26083595,"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-10-10T02:00:06.843Z","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":["c","minimalist-library","regular-expression"],"created_at":"2024-11-05T13:05:34.683Z","updated_at":"2025-10-10T10:22:54.287Z","avatar_url":"https://github.com/rafael-santiago.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Here\n\n## What is this?\n\n``Here`` or ``Libhere`` is a ``C-library`` which implements regular expressions in a simple and straightforward way.\n\n\"Here\" is a sub-project from [``Hefesto``](https://github.com/rafael-santiago/hefesto) project and it can be understood\nas ``He``festo's ``R``egular ``E``xpressions.\n\nThis library is not POSIX compliant because my main goal in this project is to keep the things simple and not bloated.\n\n## How to build here?\n\nIn order to build \"here\" you need to use [Hefesto](https://github.com/rafael-santiago/hefesto.git).\n\nAfter you had ``Hefesto`` installed on your system just type ``hefesto``. Being inside the libhere's ``src`` sub-directory. Something like:\n\n```\nroot@moloko:~/here# cd src\nroot@moloko:~/here/src# hefesto\n```\n\nIf all works a \".a\" file will be within the ``src/lib`` sub-directory. Now you can use it to link the ``libhere`` against your projects.\n\n## How to use libhere within my code?\n\nBasically ``libhere`` exposes for you functions for matching and replacing data.\n\nIf you need to match something, in general you should do:\n\n```c\n(...)\n\n#include \u003chere.h\u003e\n\n(...)\n\nhere_search_program_ctx *search_program = NULL;\nhere_search_result_ctx *search_result = NULL;\nchar error_messages[4096];\n\n(...)\n\nsearch_program = here_compile(\".*6655321.*\", error_messages);\n\nif (search_program == NULL) {\n    //  If you don't want to know details about compilation errors\n    //  just pass NULL instead of a message buffer to here_compile()\n    //  function.\n    printf(\"Regex compile ERROR: %s\\n\", error_messages);\n    exit(1);\n}\n\nsearch_result = here_match_string(user_data_buffer, search_program);\n\nif (here_matches(search_result)) {\n    printf(\"Pattern found.\\n\");\n    del_here_search_result_ctx(search_result);\n}\n\ndel_here_search_program_ctx(search_program);\n\n(...)\n```\n\nIf you need to replace something you should do:\n\n```c\n(...)\n\n#include \u003chere.h\u003e\n\n(...)\n\nhere_search_program_ctx *search_program = NULL;\nhere_search_result_ctx *search_result = NULL;\nchar *output = NULL;\nsize_t output_size = 0;\nint replacements = 0;\n\n(...)\n\nsearch_program = here_compile(\"6655321\", NULL);\n\nif (search_program == NULL) {\n    printf(\"The supplied regex has errors.\\n\");\n    exit(1);\n}\n\nreplacements = here_replace_string(user_data_buffer, search_program, \"Alex\", \u0026output, \u0026output_size);\n\nif (replacements \u003e 0) {\n    printf(\"%d replacements had done -\u003e %s\\n\", replacements, output);\n}\n\ndel_here_search_program_ctx(search_program);\n\n(...)\n```\n\nFrom here everything is simple! ;)\n\nEnjoy!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frafael-santiago%2Fhere","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frafael-santiago%2Fhere","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frafael-santiago%2Fhere/lists"}