It didn't work first, because there was a "$" in the string (it looked like "abc$match"), so took only the part after "$" (and it looked like "match")and it work well. Thank you very much.
By the way, are there any "good" Sketchup Ruby Tutorials/Books for Beginners? I would really like to learn it.