{"id":21674999,"url":"https://github.com/thaliaarchi/decus-grep-rust","last_synced_at":"2026-05-18T17:41:27.227Z","repository":{"id":239740451,"uuid":"800425991","full_name":"thaliaarchi/decus-grep-rust","owner":"thaliaarchi","description":"A port of the historical DECUS grep.c to Rust","archived":false,"fork":false,"pushed_at":"2024-05-14T21:01:46.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-25T10:08:24.065Z","etag":null,"topics":["decus","grep","history-of-computing","regexp","vms"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thaliaarchi.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":"2024-05-14T10:06:09.000Z","updated_at":"2024-05-14T21:01:50.000Z","dependencies_parsed_at":"2024-05-14T11:30:53.056Z","dependency_job_id":"b84ac17d-7e0b-45f6-87c2-b5610494f1cb","html_url":"https://github.com/thaliaarchi/decus-grep-rust","commit_stats":null,"previous_names":["thaliaarchi/decus-grep-rust"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thaliaarchi%2Fdecus-grep-rust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thaliaarchi%2Fdecus-grep-rust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thaliaarchi%2Fdecus-grep-rust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thaliaarchi%2Fdecus-grep-rust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thaliaarchi","download_url":"https://codeload.github.com/thaliaarchi/decus-grep-rust/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244583159,"owners_count":20476233,"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":["decus","grep","history-of-computing","regexp","vms"],"created_at":"2024-11-25T13:50:34.625Z","updated_at":"2026-05-18T17:41:22.173Z","avatar_url":"https://github.com/thaliaarchi.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DECUS grep in Rust\n\nA port of the historical DECUS [grep.c](grep.c) to Rust.\n\ngrep.c was originally written in 1980 for VMS and distributed for free as source\nby the Digital Equipment Corporation Users' Society. It was easy to embed and\nappeared in in many applications, and was particularly influential in DOS\ncircles.\n\nTo modern eyes, it has peculiar syntax. Optional is written as `-` instead of\n`?`. Named character classes are written with colon instead of backslash: `:a`\nfor `[A-Za-z]`, `:d` for `[0-9]`, `:n` for `[A-Za-z0-9]`, and `: ` for `[␁- ]`\n(Perl `[\\x01- ]`). The pattern and searched text are both case-insensitive.\n\nMore striking are the features it is missing. It has no alternation nor group,\nso sub-patterns that are not exactly one byte cannot be alternated or repeated.\n\nI have reconstructed an early version of DECUS grep in [./grep.c](grep.c) and\nminimally updated it for modern compilers in [./grep_modern.c](grep_modern.c).\n\nIts original documentation is as follows:\n\n```\ngrep searches a file for a given pattern.  Execute by\ngrep [flags] regular_expression file_list\n\nFlags are single characters preceeded by '-':\n-c      Only a count of matching lines is printed\n-f      Print file name for matching lines switch, see below\n-n      Each line is preceeded by its line number\n-v      Only print non-matching lines\n\nThe file_list is a list of files (wildcards are acceptable on RSX modes).\n\nThe file name is normally printed if there is a file given.\nThe -f flag reverses this action (print name no file, not if more).\n\nThe regular_expression defines the pattern to search for.  Upper- and\nlower-case are always ignored.  Blank lines never match.  The expression\nshould be quoted to prevent file-name translation.\nx      An ordinary character (not mentioned below) matches that character.\n'\\'    The backslash quotes any character.  \"\\$\" matches a dollar-sign.\n'^'    A circumflex at the beginning of an expression matches the\n       beginning of a line.\n'$'    A dollar-sign at the end of an expression matches the end of a line.\n'.'    A period matches any character except \"new-line\".\n':a'   A colon matches a class of characters described by the following\n':d'     character.  \":a\" matches any alphabetic, \":d\" matches digits,\n':n'     \":n\" matches alphanumerics, \": \" matches spaces, tabs, and\n': '     other control characters, such as new-line.\n'*'    An expression followed by an asterisk matches zero or more\n       occurrances of that expression: \"fo*\" matches \"f\", \"fo\"\n       \"foo\", etc.\n'+'    An expression followed by a plus sign matches one or more\n       occurrances of that expression: \"fo+\" matches \"fo\", etc.\n'-'    An expression followed by a minus sign optionally matches\n       the expression.\n'[]'   A string enclosed in square brackets matches any character in\n       that string, but no others.  If the first character in the\n       string is a circumflex, the expression matches any character\n       except \"new-line\" and the characters in the string.  For\n       example, \"[xyz]\" matches \"xx\" and \"zyx\", while \"[^xyz]\"\n       matches \"abc\" but not \"axb\".  A range of characters may be\n       specified by two characters separated by \"-\".  Note that,\n       [a-z] matches alphabetics, while [z-a] never matches.\nThe concatenation of regular expressions is a regular expression.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthaliaarchi%2Fdecus-grep-rust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthaliaarchi%2Fdecus-grep-rust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthaliaarchi%2Fdecus-grep-rust/lists"}