Hi Sravanthi
The Pos function in Webi doesn't support the parameter occurrence yet, meaning you can't directly/easily find the position of "To" when it appears the 2nd time in a string, there is a workaround for that. But, even before you try that workaround, you need to find out what is the max number of times From or To is going to appear in a string, because, depending on that max number of repetitions, the you need more variables and the formula starts becoming complex. But, may be you can do something in the Universe if you've Oracle as the Instr function (equivalent of Pos function) supports the occurrence parameter.
Check this out for instr function in Oracle SQL:
and this
https://blog.udemy.com/sql-instr/
Hope that helps.
Thanks,
Mahboob Mohammed