<commit_before>[![Build Status](https://travis-ci.org/holgerk/search-and-replace.svg)](https://travis-ci.org/holgerk/search-and-replace)
[![Coverage](http://gocover.io/_badge/github.com/holgerk/search-and-replace?0)](http://gocover.io/github.com/holgerk/search-and-replace)

# Search And Replace

## Features
- search and replace a string in the current directory
- regular expressions in search string and backreferences in replace string

## Usage
```
Usage:
  search-and-replace [OPTIONS] Search Replace

Application Options:
  -d, --dry-run      Do not change anything
  -r, --regexp       Treat search string as regular expression
  -v, --verbose      Show verbose debug information
  -i, --interactive  Confirm every replacement

Help Options:
  -h, --help         Show this help message

Arguments:
  Search
  Replace
```

## Demo (Interactive Mode)
![demo-interactive-mode](https://cloud.githubusercontent.com/assets/1426236/11192315/c7ed5c66-8ca0-11e5-8d8f-46ec8f18d6cd.gif)

## Examples
```
search-and-replace -r "(ba+r)(fo+)" "${2}${1}"
```

## TODO
- ignore files from .gitignore
<commit_msg>readme: explain regexp<commit_after>[![Build Status](https://travis-ci.org/holgerk/search-and-replace.svg)](https://travis-ci.org/holgerk/search-and-replace)
[![Coverage](http://gocover.io/_badge/github.com/holgerk/search-and-replace?0)](http://gocover.io/github.com/holgerk/search-and-replace)

# Search And Replace

## Features
- search and replace a string in the current directory
- regular expressions

## Usage
```
Usage:
  search-and-replace [OPTIONS] Search Replace

Application Options:
  -d, --dry-run      Do not change anything
  -r, --regexp       Treat search string as regular expression
  -v, --verbose      Show verbose debug information
  -i, --interactive  Confirm every replacement

Help Options:
  -h, --help         Show this help message

Arguments:
  Search
  Replace
```

## Demo (Interactive Mode)
![demo-interactive-mode](https://cloud.githubusercontent.com/assets/1426236/11192315/c7ed5c66-8ca0-11e5-8d8f-46ec8f18d6cd.gif)

## Examples
### Regexp
match baarfooo and replace with fooobaar
```
search-and-replace -r "(ba+r)(fo+)" "${2}${1}"
```

## TODO
- ignore files from .gitignore

{'fraction_non_alphanumeric': 0.14627539503386006, 'fraction_numerical': 0.03160270880361174, 'mean_word_length': 3.9354120267260577, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5656904', 'n_tokens_mistral': 797, 'n_tokens_neox': 746, 'n_words': 169}