|
@@ -46,11 +46,11 @@ public class StyledMessageUtils {
|
46
|
46
|
*/
|
47
|
47
|
public String stripControlCodes(final String input) {
|
48
|
48
|
return input.replaceAll("[" + IRCControlCodes.BOLD + CODE_CHANNEL + IRCControlCodes.FIXED
|
49
|
|
- + CODE_HYPERLINK + IRCControlCodes.ITALIC + IRCControlCodes.NEGATE + CODE_NICKNAME
|
|
49
|
+ + CODE_HYPERLINK + IRCControlCodes.ITALIC + IRCControlCodes.NEGATE
|
50
|
50
|
+ CODE_SMILIE + IRCControlCodes.STOP + IRCControlCodes.UNDERLINE + "]|"
|
51
|
51
|
+ IRCControlCodes.COLOUR_HEX + "([A-Za-z0-9]{6}(,[A-Za-z0-9]{6})?)?|"
|
52
|
52
|
+ IRCControlCodes.COLOUR + "([0-9]{1,2}(,[0-9]{1,2})?)?", "")
|
53
|
|
- .replaceAll(CODE_TOOLTIP + ".*?" + CODE_TOOLTIP + "(.*?)" + CODE_TOOLTIP, "$1");
|
|
53
|
+ .replaceAll("([" + CODE_TOOLTIP + CODE_NICKNAME + "]).*?\\1(.*?)\\1", "$2");
|
54
|
54
|
}
|
55
|
55
|
|
56
|
56
|
/**
|
|
@@ -108,10 +108,9 @@ public class StyledMessageUtils {
|
108
|
108
|
* @return a copy of the input with control codes removed
|
109
|
109
|
*/
|
110
|
110
|
private String stripInternalControlCodes(final String input) {
|
111
|
|
- return input.replaceAll("[" + CODE_CHANNEL + CODE_HYPERLINK + CODE_NICKNAME
|
|
111
|
+ return input.replaceAll("[" + CODE_CHANNEL + CODE_HYPERLINK
|
112
|
112
|
+ CODE_SMILIE + IRCControlCodes.STOP + IRCControlCodes.UNDERLINE + ']', "")
|
113
|
|
- .replaceAll(CODE_TOOLTIP + ".*?" + CODE_TOOLTIP + "(.*?)"
|
114
|
|
- + CODE_TOOLTIP, "$1");
|
|
113
|
+ .replaceAll("([" + CODE_TOOLTIP + CODE_NICKNAME + "]).*?\\1(.*?)\\1", "$2");
|
115
|
114
|
}
|
116
|
115
|
|
117
|
116
|
}
|