ASP.NET C#替换字符 与 正则表达式

求替换文本当中正则表达式不符合^(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])$ 的所有字符为空白该怎么办?

待编辑的文档为1.txt
这是IP地址的正则表达式
string path = 文件路径;
StreamReader objReader = new StreamReader(path);
string sLine = "";
StringBuilder sb = new StringBuilder();
while (sLine != null)
{
sLine = objReader.ReadLine();
if (sLine != null && !sLine.Equals(""))
{
//判断是拿卜渗否匹配
string strPattern = @"^(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\弊仿.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])$";
System.Text.RegularExpressions.Regex reg1 = new System.Text.RegularExpressions.Regex(strPattern);
if (reg1.IsMatch(sLine))
{
//替换
sLine = System.Text.RegularExpressions.Regex.Replace(sLine, strPattern, "");
}
sb.Append(sLine).Append("\r\n");//加入回车换行消脊符
}

}
objReader.Close();

FileStream fs = new FileStream(path, FileMode.Create);
StreamWriter sw = new StreamWriter(fs);
//开始写入
sw.Write(sb.ToString());
//清空缓冲区
sw.Flush();
//关闭流
sw.Close();
fs.Close();
这是tpaxatb大神的回答册搭尺。我给枝纤粘贴过来

perl -i.bak -w -ne 's/[^\n\s](?!\d{1,3}\.?)/"州高"/g' 1.txt
Regex re = new Regex(@"镇扰拦[^\御胡n\李卖s](?!\d{1,3}\.?)", RegexOPtions.Global);
你这个似乎全部数字的匹配!