In my earlier blog post I outlined that I wanted to further improve bug functionality for the OnScroll patch. Bugs that were only 5 digits long were not being converted into proper links. For example bug 12345 or b#12345 or 12345. I was only covering bugs that were 6 digits in length. The following is my old bug regexps:
1 2 3 | re = new RegExp("[bB][uU][gG]\s\d{6}"); re2 = new RegExp("b=\d{6}"); re3 = new RegExp("\d{6}\W"); |
Now have a look at my new bug regexes:
1 2 3 | re = new RegExp('[bB][uU][gG]sd{5,}'); re2 = new RegExp('b=d{5,}'); re3 = new RegExp('d{5,}W'); |
As you can see the regexp implementation hasn’t changed very much. The only change was that ’6′ became ’5,’ and now the 5 digit bugs are converted into bug links properly. Basically ’5,’ specifies that anything >=5 digits should be converted into bug links. Furthermore, 7 digit bugs will start to appear eventually (if they haven’t already, not sure). This implementation automatically takes care of that situation.
Another thing you will notice in my new implementation is that the regexps no longer use double quotes. Instead, I’m now using single quotes which means that I don’t need to use the double backward slash as an escape character.
There are still 3- and 4-digit bugs open. Is there a reason that you’re not trying to take those into account?
Nice site. I just bookmarked you on my bloglines.
Sent from my iPhone 4G