I would use Regex.Replace(). The regular expression will match the unquoted string, followed by the quoted string, and the matching evaluator will replace testin the non-command part. Something like that:
Regex.Replace("This is test, 'this is test inside quote' test",
@"(.*?)((?<quote>[""']).*?\k<quote>|$)",
m => m.Groups[1].Value.Replace("test", "") + m.Groups[2].Value)
Group 1 is the non-command part, group 2 is the quoted part (or end of line). The result of the above is:
This is , 'this is test inside quote'