【发布时间】:2017-09-22 19:44:31
【问题描述】:
在经历了很多挫折和阅读文档之后,我似乎仍然找不到运行正则表达式模式搜索并替换该模式电子表格中所有匹配项中的字符的方法。
我在一个单元格中有这个内容:
$test string[0] = "this is a test string."; $another test string[431] = "yet another test string";
这是我的正则表达式模式:
"\$(.*?)\["
输出:
test string, another test string
我需要找到所有匹配项并将空格替换为连字符,以便输出为:
test-string, another-test-string
关于如何做到这一点的任何想法?
提前致谢!
【问题讨论】:
-
输出为:
test-string, another-test-string,其余的被忽略?我几乎可以肯定您必须分两步完成此操作。 -
基本上我只想对我在正则表达式中搜索的内容进行查找和替换。完整的输出将是:
$test-string[0] = "this is a test string."; $another-test-string[431] = "yet another test string";
标签: regex excel vb.net replace find