mrshu / brutal-plugins

A set of plugins for brutal, the mighty chatbot
Apache License 2.0
4 stars 2 forks source link

basic: Escaped pattern in sed #85

Closed mrshu closed 9 years ago

mrshu commented 9 years ago

Signed-off-by: mr.Shu mr@shu.io

mrshu commented 9 years ago

@pepol this fixes the bug you saw earlier today

cc @Adman

mrshu commented 9 years ago

to @pepol

pepol commented 9 years ago

@mrshu are you sure? From what I saw, the bug is in the fact that it takes the ending separator as part of replacement, which is should not, obviously...

mrshu commented 9 years ago

@pepol that's a separate issue. This fixes the s/++/++++ issue.

pepol commented 9 years ago

I see.

pepol commented 9 years ago

LGTM, then, go ahead and merge it.

mrshu commented 9 years ago

@pepol the other problem is the+ in r'^s([^ a-zA-Z0-9])(.*?)\1(.*?)(?:\1(.+?))?$'. That boils down to this issue with older python res. Will see if I can get around that.

pepol commented 9 years ago

@mrshu why not put ([^\1]+) or something like that there?

mrshu commented 9 years ago

@pepol that's probably also possible, I did it in a bit more obvious way.

pepol commented 9 years ago

Well, LGTM then! Thanks @mrshu