supybot parses regular expressions crudely and incorrectly for String plugin's re command
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
supybot (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: supybot
Ubuntu 8.04, supybot 0.83.3-1.
supybot's `re' command in the String plugin doesn't handle backslashes
well. Given `re s/\//x/ a/bc' it correctly seperates the two parts `\/'
and `x', returning `axbc', but it seems to do this by splitting the
string on the `/' separator when it's not preceeded by a backslash.
This logic is flawed:
re s/\//x/ a/bc
axbc
re s/\\/x/ a/bc
Error: 's/\\\\/x/ a/bc' is not a valid regular expression.
Here, the backslash preceeding the separator is part of the escape
started with the first backslash, so the second `/' isn't escaped and
shouldn't be treated as such. Also, the error message seems to
over-escape the backslashes.
This is now fixed upstream and will be included in 0.83.4. Thanks for the bug report.