Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/surjikal/reg
Minimal sed-like tool with JS regexp syntax
https://github.com/surjikal/reg
Last synced: about 2 months ago
JSON representation
Minimal sed-like tool with JS regexp syntax
- Host: GitHub
- URL: https://github.com/surjikal/reg
- Owner: surjikal
- Created: 2014-12-01T00:11:15.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2014-12-01T00:23:29.000Z (about 10 years ago)
- Last Synced: 2024-04-16T00:57:58.552Z (8 months ago)
- Homepage:
- Size: 172 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
reg
===Minimal sed-like tool for text replacements using JS regex syntax.
Cause it's easier to reimplement sed than to remember its regex syntax.
## Usage
```
reg
```This maps directly to Javascript's `String.replace` function:
```javascript
var regex = new RegExp(, );
str.replace(regex, );
```#### Examples
```bash
cat /etc/passwd | reg :.*cat /etc/passwd | reg (.*?):.* "User: \$1"
```