Regex.Replace("a b c a b c", "a", "*")
returns
"* b c * b c"
Is there a simple way to replace only the first occurence, such that the result is
"* b c a b c"
Cannot find a RegExOption that would limit the replacement. In particular
Regex.Replace("a b c a b c", "a", "*", RegexOptions.Multiline)
Regex.Replace("a b c a b c", "a", "*", RegexOptions.Singleline)
do not make any difference - obviously. There are not much more options however.