using System;
using System.Text.RegularExpressions;
public class Test
{
public static void Main()
{
var text = "SUBTOTAL 34.37 TAX TOTAL 37.43";
var idx = Regex.Match(text, @"\bTOTAL\b").Index;
Console.WriteLine(idx);
}
}
dXNpbmcgU3lzdGVtOwp1c2luZyBTeXN0ZW0uVGV4dC5SZWd1bGFyRXhwcmVzc2lvbnM7CgpwdWJsaWMgY2xhc3MgVGVzdAp7CglwdWJsaWMgc3RhdGljIHZvaWQgTWFpbigpCgl7CgkJdmFyIHRleHQgPSAiU1VCVE9UQUwgMzQuMzcgVEFYIFRPVEFMIDM3LjQzIjsKCQl2YXIgaWR4ID0gUmVnZXguTWF0Y2godGV4dCwgQCJcYlRPVEFMXGIiKS5JbmRleDsKCQlDb25zb2xlLldyaXRlTGluZShpZHgpOwoJfQp9