Skip to content

malthejorgensen/repx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

repx

Python regular expression file transformer.

If you know sed or awk – or even vim's search & replace functionality, repx should feel familiar, but simpler and easier to use.

Usage

By default repx will take input from standard in and output the transformed text to standard out

$ echo 'Hello World!' | repx /World/Universe/
Hello Universe

File input and output is of course also supported

$ cat in.txt
I like command line tools!
$ repx /like/love/ in.txt -o out.txt
$ cat out.txt
I love command line tools!

Files can be transformed in-place (use -f or --force to skip the confirmation)

$ repx -p /like/love/ in.txt
Do you really want to replace the contents of `in.txt`,
-- the content will permanently and irrevocably be changed!
Type `in.txt` to replace the file: in.txt (user input)
$ cat in.txt
I love command line tools!

Releases

No releases published

Packages

No packages published

Languages