An open API service indexing awesome lists of open source software.

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

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.
```