急求正则表达式处理字符串 string result = Regex.Replace("内容", @"([\w]*?,[\w]+)", "\"$1\""); 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 str=Regex.Replace(str,@"\w+,\w+","'$0'"); 不符合啊 "Time:2013-11-11 10:54.41\r\nPoint\tZ\t\r\n{X=-147, Y=0}\t1660.9\t\r\n{X=-141.12, Y=0}\t1660.9\t\r\n{X=-135.24, Y=0}\t1660.9\t\r\n"对这个字符串 希望匹配后能变成"Time:2013-11-11 10:54.41Point Z '{X=-147, Y=0} '1660.9 '{X=-141.12, Y=0} '1660.9 '{X=-135.24, Y=0} '1660.9" 还是不行我是想把一个字符串"Time:2013-11-11 10:54.41\r\nPoint\tZ\t\r\n{X=-147, Y=0}\t1660.9\t\r\n{X=-141.12, Y=0}\t1660.9\t\r\n{X=-135.24, Y=0}\t1660.9\t\r\n"写到CSV文件里头,这样显示唉..:Time 2013-11-11 10:54.41Point Z{X=-147, Y=0} 1660.9{X=-141.12, Y=0} 1660.9{X=-135.24, Y=0} 1660.9 不符合啊 "Time:2013-11-11 10:54.41\r\nPoint\tZ\t\r\n{X=-147, Y=0}\t1660.9\t\r\n{X=-141.12, Y=0}\t1660.9\t\r\n{X=-135.24, Y=0}\t1660.9\t\r\n"对这个字符串 希望匹配后能变成"Time:2013-11-11 10:54.41Point Z '{X=-147, Y=0} '1660.9 '{X=-141.12, Y=0} '1660.9 '{X=-135.24, Y=0} '1660.9" string result = Regex.Replace("内容", @"{.*?,[^}]+?}", "'$0'"); 不符合啊 "Time:2013-11-11 10:54.41\r\nPoint\tZ\t\r\n{X=-147, Y=0}\t1660.9\t\r\n{X=-141.12, Y=0}\t1660.9\t\r\n{X=-135.24, Y=0}\t1660.9\t\r\n"对这个字符串 希望匹配后能变成"Time:2013-11-11 10:54.41Point Z '{X=-147, Y=0} '1660.9 '{X=-141.12, Y=0} '1660.9 '{X=-135.24, Y=0} '1660.9" string result = Regex.Replace("内容", @"{.*?,[^}]+?}", "'$0'");如果原数据没有{和}呢? 不符合啊 "Time:2013-11-11 10:54.41\r\nPoint\tZ\t\r\n{X=-147, Y=0}\t1660.9\t\r\n{X=-141.12, Y=0}\t1660.9\t\r\n{X=-135.24, Y=0}\t1660.9\t\r\n"对这个字符串 希望匹配后能变成"Time:2013-11-11 10:54.41Point Z '{X=-147, Y=0} '1660.9 '{X=-141.12, Y=0} '1660.9 '{X=-135.24, Y=0} '1660.9" string result = Regex.Replace("内容", @"{.*?,[^}]+?}", "'$0'");如果原数据没有{和}呢?string result = Regex.Replace("内容", @"\S+,[ ]\S+", "'$0'"); 字符串处理 求助:c# winform 与 windows media player 控件之间的问题 这段代码得到的是物理序列号还是逻辑序列号? Rectangle 里的height为负,什么意思,DrawImage取的什么部分? DropDownlist联动 查询报错! DataSource不能赋值,总是弹出“未将对象引用到实例”! 如何在窗体使用各功能键(如F2,F4等)作为快捷键 程序设置启动页,怎么回事? c#图像的平移 在C#中如何实现通过扫描条码获得商品数据?(急) 利用C#发手机短信,哪个接口或平台好用 完全小白,急求大神指点第一个小程序
"Time:2013-11-11 10:54.41
Point Z
'{X=-147, Y=0} '1660.9
'{X=-141.12, Y=0} '1660.9
'{X=-135.24, Y=0} '1660.9"
"Time:2013-11-11 10:54.41\r\nPoint\tZ\t\r\n{X=-147, Y=0}\t1660.9\t\r\n{X=-141.12, Y=0}\t1660.9\t\r\n{X=-135.24, Y=0}\t1660.9\t\r\n"写到CSV文件里头,这样显示唉..:
Time 2013-11-11 10:54.41
Point Z
{X=-147, Y=0} 1660.9
{X=-141.12, Y=0} 1660.9
{X=-135.24, Y=0} 1660.9
"Time:2013-11-11 10:54.41
Point Z
'{X=-147, Y=0} '1660.9
'{X=-141.12, Y=0} '1660.9
'{X=-135.24, Y=0} '1660.9"
string result = Regex.Replace("内容", @"{.*?,[^}]+?}", "'$0'");
"Time:2013-11-11 10:54.41
Point Z
'{X=-147, Y=0} '1660.9
'{X=-141.12, Y=0} '1660.9
'{X=-135.24, Y=0} '1660.9"
string result = Regex.Replace("内容", @"{.*?,[^}]+?}", "'$0'");如果原数据没有{和}呢?
"Time:2013-11-11 10:54.41
Point Z
'{X=-147, Y=0} '1660.9
'{X=-141.12, Y=0} '1660.9
'{X=-135.24, Y=0} '1660.9"
string result = Regex.Replace("内容", @"{.*?,[^}]+?}", "'$0'");如果原数据没有{和}呢?
string result = Regex.Replace("内容", @"\S+,[ ]\S+", "'$0'");