revise "([^/]+)$" into '([^/]+)$' in a lot of files under a directory.

Pieter van Oostrum pieter-l at vanoostrum.org
Mon Nov 18 05:04:46 EST 2019


Hongyi Zhao <hongyi.zhao at gmail.com> writes:

> On Sun, 17 Nov 2019 20:28:55 +0100, Pieter van Oostrum wrote:
>
>> To be honest, I myself would use Emacs, with rgrep and wgrep to do this.
>
> Are these tools superior to grep?

They are based on grep. But rgrep does a grep through a whole directory tree, or a selection thereof, specified by a file pattern.
The wgrep allows you to edit the grep output, for example just changing "([^/]+)$" to '([^/]+)$'.
And then you let it write the changes back to those files.
The advantage is that you see what you are doing.

But now this has become off-topic with regard to Python.
-- 
Pieter van Oostrum
WWW: http://pieter.vanoostrum.org/
PGP key: [8DAE142BE17999C4]


More information about the Python-list mailing list