I was fixing my code for aNILEators emoticons and apparently Plus! doesn't like the syntax of the regex I made
Error: Syntax error in regular expression (code: -2146823271). I couldn't see anything wrong with it so I thought I'd use regex coach (like we use with work) and it said everything was caturing correctly. I realise it is made more for perl than JScript, but there is nothing in it that should make an difference (perl is the one which is less lenient). So I've come to the conclusion that there is something wrong with Plus!'s error checking. I asked Cookie to check it out but I guess he has had no time, and I've been busy doing holiday stuff with the family. If anyone would like to give it a go here is the code that I used.
code:
var emails = new Array("email.address@gmail.com");
var re = new RegExp(":(?:|[DOP()$@S]|-[#*])|\((?:[6e~#r*d&@lkfwz%]|co?|au?|[ima]p?|um?|x{1,2}|yn?|h5?|s[nto]?|pi?|tu?|[nb](?:ah)?|brb|\{\)\(\})\)|8(?:-|o)\||\^o\)|\+o\(","gi");
function OnEvent_ChatWndSendMessage(pChatWnd,sMessage){
for(i in emails){
if (Messenger.MyUserId == emails[i]){
return sMessage.replace(re,function($1){
Debug.Trace($1);
if($1.charAt(0) === ":"){
$1.replace(/:-?/,"=");
}else if($1.charAt(0) === "("){
$1.replace(/\(|\)|\*|&/g,function($1){
Debug.Trace($1);
switch($1){
case "(": return "{";
case ")": return "}";
case "*": return "*2";
case "&": return "dog";
}
});
}else{
switch($1){
case "8-|": return "8o)";
case "^o)": return "=/";
case "\+o(": return "=o(";
case "8o|": return "=o|";
}
}
});
}
}
}
Also for those interested,
Regex Coach.
If ou don't understand the regex then you probably will not understand how to find the problem, I'm sorry to be so blunt but it is not easy (at least I took away the look behinds
).
The regex is to capture all of the default emoticons that are changed with aNILEator's emoticons and is stored in the
re variable (line 2).
Thanks to anyone who can track this down, normall I would do a better jo at my bug report, but you know how it is with holidays and borrowing internet