I assume that you will have the title part in a separate string, so that the regex I provided will work. This could be done multiple ways, using either regex of your own, or use the XML xpath stuff to get them.
Here is an example of using your own regex:
using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
namespace RegexPrac1
{
class Program
{
public static Regex regExTitleContent = new Regex(@"^[^a-zA-Z]*|\s*$", RegexOptions.IgnoreCase | RegexOptions.Multiline);
public static Regex regExFullTitle = new Regex(@"(?<starttag><title>)(?<titlecontent>[^<]*)(?<endtag></title>)", RegexOptions.IgnoreCase | RegexOptions.Multiline);
static void Main(string[] args)
{
String strInput = "what ever <title> 2.3.4_File Is Good </title> or something more <title> 12 Yes </title> blah etc";
MatchEvaluator evaluator = new MatchEvaluator(ProcessTitle);
String strOutput = regExFullTitle.Replace(strInput, evaluator);
Console.WriteLine("START------" + strOutput + "-------END");
}
static string ProcessTitle(Match match)
{
string fullTitle = match.Groups["titlecontent"].Value;
return match.Groups["starttag"].Value + regExTitleContent.Replace(fullTitle, "") + match.Groups["endtag"].Value;
}
}
}