using System;
using System.IO;
using System.Text.RegularExpressions;
using System.Linq;
public class Test
{
public static void Main()
{
var s = "widgets All men like widgets but some men like widgets more than others";
var chunks = Regex.Split(s, @"(\s*\bwidgets\b\s*)");
var result = string.Concat(chunks.Select((i, index) => index % 2 == 0 && !string.IsNullOrWhiteSpace(i) ? $"<b>{i}</b>" : i));
Console.WriteLine(result);
}
}
dXNpbmcgU3lzdGVtOwp1c2luZyBTeXN0ZW0uSU87CnVzaW5nIFN5c3RlbS5UZXh0LlJlZ3VsYXJFeHByZXNzaW9uczsKdXNpbmcgU3lzdGVtLkxpbnE7CnB1YmxpYyBjbGFzcyBUZXN0CnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBNYWluKCkKCXsKCQl2YXIgcyA9ICJ3aWRnZXRzIEFsbCBtZW4gbGlrZSB3aWRnZXRzIGJ1dCBzb21lIG1lbiBsaWtlIHdpZGdldHMgbW9yZSB0aGFuIG90aGVycyI7CgkJdmFyIGNodW5rcyA9IFJlZ2V4LlNwbGl0KHMsIEAiKFxzKlxid2lkZ2V0c1xiXHMqKSIpOwoJCXZhciByZXN1bHQgPSBzdHJpbmcuQ29uY2F0KGNodW5rcy5TZWxlY3QoKGksIGluZGV4KSA9PiBpbmRleCAlIDIgPT0gMCAmJiAhc3RyaW5nLklzTnVsbE9yV2hpdGVTcGFjZShpKSA/ICQiPGI+e2l9PC9iPiIgOiBpKSk7CiAgICAgICAgQ29uc29sZS5Xcml0ZUxpbmUocmVzdWx0KTsKCX0KCQoJCn0KCg==