Open elifarley opened 2 weeks ago
If I use an address range, it works:
,/def convert/s/self, //
But I need to perform the replacements only on each line that matches /def convert/
The correct syntax is:
H
g/def convert/s/self, //
g/self\.convert/s/self\.\(convert\)/\1/g
w
q
Standard ed
performs the changes as expected and outputs:
286
270
Your ed command doesn't change anything and then outputs:
287
def convert(self, number, from_digits, to_digits, sign):
neg, value = self.convert(i, self.decimal_digits, self.digits, "-")
neg, value = self.convert(s, self.digits, self.decimal_digits, self.sign)
286
Hi, thanks for the feedback. I will look in to it, I am quite surprised that the tests aren't failing for the global command but I guess there are edge cases.
EDIT:
Actually the correct syntax is:
H
g/def convert/s/self, //
g/self\.convert/s/self\.(convert)/\1/g
w
q
Escaping the parentheses is not needed in RE2, but I am aware that the substitute command isn't working as expected.
Hi! Tack a lot for creating this
ed
clone. I need to include this in a code processing runtime (CEDARScript), but I could not get it to work.Could you help me, please?
Here's the file that needs editing:
And here's the file with the editing script:
And this is the sequence of commands I tried:
Now, if I use
ed
that comes in MacOS X, I get a different error:Do you have any idea of what's wrong here?
Thank you!