Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

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

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