Как насчет этого:
string input = "Hello _tmp_ how is _tmp_ this possible _tmp_ in C#...?";
string[] array = { "value1", "value2", "value3" };
Regex rx = new Regex(@"\b_tmp_\b");
if (rx.Matches(input).Count <= array.Length)
{
int index = 0;
string result = rx.Replace(input, m => array[index++]);
Console.WriteLine(result);
}
Необходимо убедиться, что количество найденных совпадений никогда не превышает длину массива, как показано выше.
РЕДАКТИРОВАТЬ: в ответ на комментарий, это может легко работать с C # 2.0, заменив лямбду следующим:
string result = rx.Replace(input, delegate(Match m) { return array[index++]; });