{"id":16573576,"url":"https://github.com/v2e4lisp/mch","last_synced_at":"2025-09-02T14:38:16.569Z","repository":{"id":146654015,"uuid":"76961797","full_name":"v2e4lisp/mch","owner":"v2e4lisp","description":"match line","archived":false,"fork":false,"pushed_at":"2017-01-17T12:33:07.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-16T03:51:35.764Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","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/v2e4lisp.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":"2016-12-20T14:08:59.000Z","updated_at":"2016-12-20T14:09:14.000Z","dependencies_parsed_at":"2023-04-26T07:46:27.968Z","dependency_job_id":null,"html_url":"https://github.com/v2e4lisp/mch","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/v2e4lisp%2Fmch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/v2e4lisp%2Fmch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/v2e4lisp%2Fmch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/v2e4lisp%2Fmch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/v2e4lisp","download_url":"https://codeload.github.com/v2e4lisp/mch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242049074,"owners_count":20063503,"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":[],"created_at":"2024-10-11T21:42:33.132Z","updated_at":"2025-03-05T15:22:31.946Z","avatar_url":"https://github.com/v2e4lisp.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"mch is a simple command for text manipulation.\n\nmch reads from the stdin line by line, matching each one against the input pattern (specified by `-i`).\nIf a line is fully matched it will be printed out to the stdout based on the output pattern (specified by `-o`).\n\nIn the input pattern, everything except `$` is matched as it is, while `$` matches 0 or more chars until it meets its following char.\nFor exmaple, the `$` in `$c` matches anything as long as it's not `c`.\n\nIn the output pattern, `$` followed by a number refers to the string that is matched by its counterpart in the input pattern.\nThe number works as an index starting from 1; `$0` refers to the whole line. As in the input pattern everything else is what it is, no escape is available.\n\nmch doesn't support unicode.\n\n\n```\n# Example: extract uri from nginx access log\n\n$ echo '123.65.150.10 - - [23/Aug/2010:03:50:59 +0000] \"POST /wordpress3/wp-admin/admin-ajax.php HTTP/1.1\" 200 2 \"http://www.example.com/wordpress3/wp-admin/post-new.php\" \"Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_4; en-US) AppleWebKit/534.3 (KHTML, like Gecko) Chrome/6.0.472.25 Safari/534.3\"' | mch -i '$ $ $ [$] \"$ $ $\"$' -o '$6'\n/wordpress3/wp-admin/admin-ajax.php\n\n# Example: csv -\u003e tsv (tab is entered by C-v [TAB])\n$ echo 'col1,col2,col3' | mch -i '$,$,$' -o '$3\t$1'\ncol3\tcol1\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fv2e4lisp%2Fmch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fv2e4lisp%2Fmch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fv2e4lisp%2Fmch/lists"}