Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/simplyyan/cutinfo
go library to extract information based on references
https://github.com/simplyyan/cutinfo
extract-data go go-lib go-library golang string-manipulation strings
Last synced: 8 days ago
JSON representation
go library to extract information based on references
- Host: GitHub
- URL: https://github.com/simplyyan/cutinfo
- Owner: simplyYan
- License: bsd-3-clause
- Created: 2024-01-20T21:38:53.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-08-27T17:55:56.000Z (4 months ago)
- Last Synced: 2024-08-27T19:47:19.713Z (4 months ago)
- Topics: extract-data, go, go-lib, go-library, golang, string-manipulation, strings
- Language: Go
- Homepage:
- Size: 18.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
![CutInfo](cutinfo.png)
# CutInfo
CutInfo is a lightweight Go library designed to extract information from text based on specified start and end tags. It is a simple and efficient tool for retrieving content between two reference points in a text string.
## Features
- Simple and easy-to-use API
- Lightweight and fast
- Retrieves content between specified start and end tags
- Handles cases with multiple occurrences of end tags by selecting content up to the first occurrence## Objective
The main goal of CutInfo is to provide a quick and easy solution for extracting information from text strings. It is particularly useful for scenarios where you need to parse HTML or similar structures and retrieve specific content between tags.
## How to Install
To use CutInfo in your Go project, you can simply run the following command:
```bash
go get -u github.com/simplyYan/cutinfo
```## How to use
```go
package mainimport (
"fmt"
"github.com/simplyYan/cutinfo"
)func main() {
ci := cutinfo.New()text := `
Document
Hello World
`
result := ci.Target(text, '
', '
')
fmt.Println(result) // Output: Hello World
}
```
1. Import the cutinfo package.
2. Create a new CutInfo instance using cutinfo.New().
3. Use the Target method to extract content between specified start and end tags.> A project founded by Wesley Yan Soares Brehmer