I want to modify my code like below but after modification my regex dont work. what I am doing wrong?
my code
Regex reg = new Regex("(ALTER TABLE .+ REFERENCES\\s+)\"USER1\"[.](.+)");
richTextBox1.Text = reg.Replace(richTextBox1.Text, "$1$2");
modified code
Regex reg = new Regex(String.Format("(ALTER TABLE .+ REFERENCES\\s+)\"{0}\"[.](.+)",textbox1.text);
richTextBox1.Text = reg.Replace(richTextBox1.Text, "$1$2");
{0}in the rickTextBox1.Text?{}are used for defined repeats usually, you could try escaping the braces:\{0\}.