https://github.com/yah01/nre
regex expression with natural language
https://github.com/yah01/nre
Last synced: 10 months ago
JSON representation
regex expression with natural language
- Host: GitHub
- URL: https://github.com/yah01/nre
- Owner: yah01
- Created: 2023-04-02T06:04:20.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-04-02T06:12:27.000Z (over 3 years ago)
- Last Synced: 2025-01-26T00:41:34.633Z (over 1 year ago)
- Language: Go
- Homepage:
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# nre
Regex expression with natural language, powered by GPT.
## Install
```
go install github.com/yah01/nre@latest"
```
## Example
```
nre -d "errors.New(), and select the parameter string"
Regex: `errors\.New\((\".*\")\)`
Explanation:
- `errors\.New\(` matches the literal string "errors.New("
- `(\".*\")` matches a string enclosed in double quotes, including any characters inside the quotes. The backslashes before the quotes are used to escape them, since quotes have a special meaning in regex. The parentheses around this part of the regex capture the string inside the quotes as a group, which can be accessed separately.
```