我试过用Konesans regex清洁剂改造我想把所有的空间字符从我的专栏中删除,
我在regex清洗机中尝试了这段代码
匹配表达式:
!@#$%^&*_+`{};':,./<>?替换表达式:
""
http://www.sqlis.com/post/RegexClean-Transformation.aspx发布于 2013-08-16 17:27:45
所以我从来没有使用过Konesans Regex Cleaner,我并不特别想下载它,但是根据您的评论,我会尽力帮助您。
在网上查看他们的样本,看起来你所要做的就是把
[!@#$%^&*_+`{};':,./<>?]在“匹配”列中,替换列中没有任何内容。可能是空字符串- ""
可以使用这测试查找和替换正则表达式。
下面是几个例子,您可以从中感受到:
String: This #is &&%^an !ugly &$%^string.
Match: [!@#$%^&*_+`{};':,./<>?]
Replace:
Result: This is an ugly string
Match: [!@#$%^&*_+`{};':,./<>?]
Replace: -
Result: This -is ----an -ugly ----string-
Match: [!@#$%^&*_+`{};':,./<>?]+
Replace: -
Result: This -is -an -ugly -string-编辑:由于不能使用空字符串,可以尝试以下操作:
Match: [!@#$%^&*_+`{};':,./<>?]()
Replace: ${1}
Result: This is an ugly string编辑2:
Match: [!@#$%^&*_+`{};':,./<>?](?<empty>)
Replace: ${empty}
Result: This is an ugly string这是通过创建一个空的捕获组并替换为()的内容来实现的。如果$1没有得到Konesans中的捕获组,我肯定会有一些类似的语法。
https://stackoverflow.com/questions/18263349
复制相似问题