【发布时间】:2011-07-10 02:21:13
【问题描述】:
我有一个简单的脚本(它使用 RegEx),它清理源字符串以仅留下 alpha-numeric-and-whitespace 个字符。
有时,我会得到一些相邻的空白字符。
例如。
source: abc def ghi
result: abc def ghi
source: a*bc D*f
result: abc df
source: a*bc *** def
result: abc def <-- notice the two spaces in there
expected result: abc def <-- notice one space, here.
所以我希望一些正则表达式可以在某些源字符串中查找 2+ 个相邻的空格,并将其替换为单个空格字符。
干杯:)
【问题讨论】:
-
Sql Server 2008 不幸的是......我想我刚刚发现它不能处理 RegEx :(
-
无论如何都不是本机:stackoverflow.com/questions/267921/…
标签: regex