I have got this simple function for reduction of more than 3 spaces to only two spaces
But I want also more general version of this function where as parameters will be number of spaces.
Here is my function but it's not optimal and I hope it can be done by some more clever RegExp without FOR/NEXT loop.
Please some RegExp guru help me increase my RegExp experiencies :-)
ConsoleWrite(ReduceSpaces(' abc def 1 2 ')& @CRLF) ConsoleWrite(ReduceSpaces('a b c d e')& @CRLF) ConsoleWrite(ReduceSpaces('abc')& @CRLF) ConsoleWrite(ReduceSpaces('')& @CRLF) ; 3 and more spaces reduces to 2 spaces Func ReduceSpaces($s) Return StringRegExpReplace($s, "\x20{3,}", " ") EndFunc
But I want also more general version of this function where as parameters will be number of spaces.
Here is my function but it's not optimal and I hope it can be done by some more clever RegExp without FOR/NEXT loop.
Please some RegExp guru help me increase my RegExp experiencies :-)