{"id":27519562,"url":"https://github.com/hymkor/exregexp-go","last_synced_at":"2025-04-18T05:25:49.497Z","repository":{"id":288141484,"uuid":"966915309","full_name":"hymkor/exregexp-go","owner":"hymkor","description":"Go package that extends the regexp library with flexible submatch-based string replacement utilities.","archived":false,"fork":false,"pushed_at":"2025-04-15T19:14:46.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-15T19:40:22.765Z","etag":null,"topics":["go","regex-extensions","regexp","string-replacement","utilities"],"latest_commit_sha":null,"homepage":"","language":"Go","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/hymkor.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,"zenodo":null}},"created_at":"2025-04-15T16:37:01.000Z","updated_at":"2025-04-15T19:14:49.000Z","dependencies_parsed_at":"2025-04-15T19:40:59.462Z","dependency_job_id":"1a669c95-1b5d-47c6-b359-aa7ce35b1e37","html_url":"https://github.com/hymkor/exregexp-go","commit_stats":null,"previous_names":["hymkor/exregexp-go"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hymkor%2Fexregexp-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hymkor%2Fexregexp-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hymkor%2Fexregexp-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hymkor%2Fexregexp-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hymkor","download_url":"https://codeload.github.com/hymkor/exregexp-go/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249435172,"owners_count":21271646,"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":["go","regex-extensions","regexp","string-replacement","utilities"],"created_at":"2025-04-18T05:25:48.916Z","updated_at":"2025-04-18T05:25:49.486Z","avatar_url":"https://github.com/hymkor.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"exregexp-go\r\n===========\r\n\r\n`exregexp-go` is a Go package that extends the standard `regexp` library by providing utilities for flexible string replacement using regular expression submatches.\r\n\r\nThis package introduces the `ReplaceAllStringSubmatchFunc` function, which allows you to leverage capturing groups for custom replacement logic.\r\n\r\nFeatures\r\n--------\r\n\r\n- Flexible string replacement using capturing groups\r\n- Simple and intuitive API\r\n- Built on top of Go's standard `regexp` library\r\n\r\nInstallation\r\n------------\r\n\r\n```sh\r\ngo get -u github.com/hymkor/exregexp-go\r\n```\r\n\r\nUsage\r\n-----\r\n\r\nThe following example demonstrates how to use `exregexp.ReplaceAllStringSubmatchFunc`:\r\n\r\n```example.go\r\npackage main\r\n\r\nimport (\r\n    \"fmt\"\r\n    \"regexp\"\r\n\r\n    \"github.com/hymkor/exregexp-go\"\r\n)\r\n\r\nfunc main() {\r\n    re := regexp.MustCompile(`\\b([a-zA-Z]+)(\\d+)\\b`)\r\n    input := \"example123 test456 hello789\"\r\n    output := exregexp.ReplaceAllStringSubmatchFunc(re, input, func(submatches []string) string {\r\n        return fmt.Sprintf(\"%s(%s)\", submatches[1], submatches[2])\r\n    })\r\n\r\n    fmt.Println(output)\r\n}\r\n```\r\n\r\n```go run example.go|\r\nexample(123) test(456) hello(789)\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhymkor%2Fexregexp-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhymkor%2Fexregexp-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhymkor%2Fexregexp-go/lists"}