Did you replace the source text for an actual IP address?
You can wrap it in a try in case there is an invalid address, syntatically speaking
try(toInt(split("source text string","\\.")[2,0]),-1)
returns
-1
This
try(toInt(split("192.193.194.195","\\.")[2,0]),-1)
returns
194