Get size of specific word

Hello there, I’m trying to find the size of a specific word in a string:
for example

string str = "<size=15>That's a</size> <color=red><b><size=7>link</size></b></color>";

And I want to find the size of the word “link” which is 7. How can I do such a thing?

Read up on regular expressions.

using System.Text.RegularExpressions;

string haystack = "<size=15>That's a</size> <color=red><b><size=7>link</size></b></color>";
string needle = "link";

Regex regex = new Regex(@"<size=(\d+)>" + needle + @"</size>");
Match match = regex.Match(haystack);
if (match.Success)
{
  Debug.Log( "size = " + match.Groups[1].Value );
}