开发者

VBScript - Regular Expression replace spaces

开发者 https://www.devze.com 2023-01-23 01:56 出处:网络
I have a situation where using VBScript I need to check for the presence of multiple spaces. I want to check for the presence of 2 or more consecutive spaces开发者_高级运维, so \\s+ doesnt work for my

I have a situation where using VBScript I need to check for the presence of multiple spaces. I want to check for the presence of 2 or more consecutive spaces开发者_高级运维, so \s+ doesnt work for my needs.

Does anyone know how I can accomplish this using VBScript regular expressions.


Use brackets to specify how many repetitions to match. This matches two or more whitespace characters:

\s{2,}

If you want to match only space characters, just use a space instead of \s, or the character code:

\x20{2,}


This ought to do the trick:

\s{2,}
0

精彩评论

暂无评论...
验证码 换一张
取 消