0

我曾尝试在该清洁器中使用 Konesan 正则表达式清洁器转换,我希望从我的列中删除所有空间字符,

我在正则表达式清洁器中尝试了这段代码

匹配表达式:

!@#$%^&*_+`{};':,./<>?

替换表达式:

""

http://www.sqlis.com/post/RegexClean-Transformation.aspx
4

1 回答 1

0

So I've never used Konesans Regex Cleaner and I don't particularly want to download it, but as per your comment I'll try to help.

Looking at their samples online, it looks like all you have to do is put

[!@#$%^&*_+`{};':,./<>?]

in the "Match" column, and nothing at all in the replace column. Perhaps an empty string - ""

You can use this to test your find and replace regexes.

Here are a few examples so you can get a feel for it:

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-

Edit: since you can't use the empty string, you can try this:

Match: [!@#$%^&*_+`{};':,./<>?]()
Replace: ${1}
Result: This is an ugly string

Edit 2:

Match: [!@#$%^&*_+`{};':,./<>?](?<empty>)
Replace: ${empty}
Result: This is an ugly string

This works by creating an empty capturing group, and replacing with the contents of (). If $1 doesn't get the capturing group in Konesans, I'm sure some similar syntax will.

于 2013-08-16T17:27:45.277 回答