It's certainly not a bug, but you haven't looked at the examples in the manual
It's all there.
You need to change your code to selectString( what, whichMatchOnTheLine ).
I try another example:
Let's say we get this line from the MUD:
"Jim saw Jim's friend Tom who happens to be Jim's cousin."
If you want to highlight all matches of the substring "Jim" on this line, you need to do this:
selectString( "Jim", 1 )
setFgColor(255,0,0)
selectString("Jim", 2 )
setFgColor(255,0,0)
selectString("Jim",3)
setFgColor(255,0,0)
selectString() is a low level substring selection function that operates on the line where the current user cursor (->moveCursor()) is positioned.
As I've pointed out before you can use the return value of selectString() to loop over the line or use the more high level function selectCaptureGroup().
-> manual