I'm a programmer, and I'm using regExp's to simplify my life in a chat thing.
Basically, ":blue:" in a chat will essentially be replaced with "".
because there can be all… (funda kabanzi)
I'm a programmer, and I'm using regExp's to simplify my life in a chat thing.
Basically, ":blue:" in a chat will essentially be replaced with "".
because there can be all sorts of colors, I can't use replace.
Instead, I used regExp.exec(string). However, there is a major bug where every other time, the regExp.exec returns null even if there IS a match.
If the chat is ":blue:", the response will alternate as :blue:,null,:blue:,null,etc.
If the chat is ":blue: :red:" (e.g. two color blocks) the response will go :blue:,null,null,:blue:,null,null and so on.
Basically, if there are 'x' color blocks defined, the .exec will work every x+1 times, and the other times it will not find a match.
this also happens with regExp.test.
I have gone through my code hundreds of times, and finally, I decided to run it in Opera. It works PERFECTLY fine. even in IE, it works. So i had to assume it was some bug with Firefox.
I hope this question catches the attention of the MOZILLA DEVELOPERS, as this is huge.
I'm not sure if it's just me. However, I have uploaded an html file onto http://jsbattle.tablocks.com/Untitled-1.html (the subdomain had a different purpose, but i figured i would put it here), and it will alert :blue: and null (at least for me). You can view the source code.
An important note is that this .exec and .test glitch only happens inside functions. for example, regExp.exec twice just in a script tag will run fine, but while in a function abc() {regExp.exec} and executing abc(); abc(); it'll glitch out.
I have not run extensive tests to see when this glitch occurs, this is all I know.
Please help, Mozilla Developers. And if anyone knows how to contact the Mozilla Developers, tell me, or address them of this issue.