It seems correct that regex is faster in longer strings.
My example: a 364kB file content is searched for the string "<product ".
The starting point is moved to find the next and the next and so on.
However, the searched string is not found in the entire value.
I used three test commands:
i = value.IndexOf("<" & tag & " ", xstart)
i = value.IndexOf("<" & tag & " ", xstart, StringComparison.Ordinal)
i = Regex.IsMatch(value.Substring(xstart), "<" & tag & " ", RegexOptions.Singleline)
Command one (indexof standard) needs ~ 7500 ms to search the string
Command two (indexof with ordinal) needs ~ 300 ms !
command three (regex) needs ~ 650 ms (~1000ms with IgnoreCase option).