Hi,
your code doesn't need fixing because it's working fine. I've tested it (copy/paste) and it works as it should. I just gave you those alternatives because they are cleaner and faster.
This is your script in action:
[01:39] <Cellka> Searching For "ice"
[01:39] <Cellka> Result:1 Quote: 182/437 IceCold-IRC:irc.icecold-irc.net:6667
[01:39] <Cellka> Result:2 Quote: 426/437 Rizon:services.rizon.net
[01:39] <Cellka> There was 2 found matching the text "ice"
Greets