I have a string and I want to capture the number inside it and then add one to it!.
For example I have an email subject header saying "Re: Hello (1)"
I want to capture that 1 and then raise it by 2, then 3,then 4,etc. The difficulty I am having is taking into consideration the growing numbers, once it becomes say 10 or 100, that extra digit kills my current Regex expression.
int replyno = int.Parse(Regex.Match(Subject, @"\([0-9]+\)").Value);
replyno++;
string Subject = Subject.Remove(Subject.Length - 3);
TextBoxSubject.Text = Subject + "("+replyno+")";