[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RegExp.Replace


Le 02/12/2025 à 08:13, CD a écrit :
Hello,

I have a string like this:

Dim s As String = "A     B    C D   E"

s = RegExp.Replace(s, "\\s+", " ")

Print s

I would like to get "A B C D E"

What should I write in the Pattern string?
I've tried many things, without success.
So what should I change to get the desired result?

Regards


You must use the 'RegExp.Greedy' compilation option, otherwise '\\s+' only matches one space.

Regards,

--
Benoît Minisini.


Follow-Ups:
Re: RegExp.ReplaceCD <dessere.claude@xxxxxx>
References:
RegExp.ReplaceCD <dessere.claude@xxxxxx>