[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: RegExp.Replace
[Thread Prev] | [Thread Next]
- Subject: Re: RegExp.Replace
- From: CD <dessere.claude@xxxxxx>
- Date: Tue, 02 Dec 2025 16:59:11 +0100
- To: user@xxxxxxxxxxxxxxxxxxxxxx
Yes, I read the documentation, but when you're tackling a subject you're unfamiliar with, it's easy to get lost. Everything isn't necessarily clear when you're starting a new topic. strResult = regExpression.Replace(strSource, "\\s+", " ", regExpression.Greedy) Indeed, it works like that. Thank you for your help. Sincerely Le mardi 02 décembre 2025 à 11:28 +0100, Benoît Minisini a écrit : > 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, >
| Re: RegExp.Replace | Benoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx> |
| RegExp.Replace | CD <dessere.claude@xxxxxx> |
| Re: RegExp.Replace | Benoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx> |