Re: [Interest] QRegularExpression for replace

2022-12-05 Thread Scott Bloom
C#'s regular expression replacement. https://learn.microsoft.com/en-us/dotnet/standard/base-types/substitutions-in-regular-expressions?redirectedfrom=MSDN#substituting-a-numbered-group Yes, it can be done, but I think it should be built into QRegularExpression -Original Messag

Re: [Interest] QRegularExpression for replace

2022-12-05 Thread Elvis Stansvik
Maybe I'm dumb, but I'm still not sure what is being asked for. If it's regular expression replacement with back-references in the replacement string, I think that's possible with QString::replace like I showed. Elvis ___ Interest mailing list Interest@

Re: [Interest] QRegularExpression for replace

2022-12-04 Thread Thiago Macieira
On Sunday, 4 December 2022 14:51:51 PST Scott Bloom wrote: > I guess my point is, whatever happened to code less, do more 😊 Nothing. I am saying that the functionality doesn't exist and is expensive to implement, but meanwhile you can still do what you want and more effectively than the Qt imple

Re: [Interest] QRegularExpression for replace

2022-12-04 Thread Scott Bloom
I guess my point is, whatever happened to code less, do more 😊 -Original Message- From: Interest On Behalf Of Thiago Macieira Sent: Sunday, December 4, 2022 9:46 AM To: interest@qt-project.org Subject: Re: [Interest] QRegularExpression for replace On Saturday, 3 December 2022 23:02

Re: [Interest] QRegularExpression for replace

2022-12-04 Thread Elvis Stansvik
Den tors 1 dec. 2022 kl 20:44 skrev Scott Bloom : > > Im looking for a way using QRE to do something like the following > > > > auto regEx = QRegularExpression( “(?.*)” ); > > if ( regEx.match( string ) ) > > auto newString = regEx.replace( string, “${name}” ); It's a bit hard to k

Re: [Interest] QRegularExpression for replace

2022-12-04 Thread Thiago Macieira
On Saturday, 3 December 2022 23:02:24 PST Scott Bloom wrote: > That is basically what I did for the non problematic replacements. The ones > that not only need the captured text, but also need the rest of the text I > didn't bother implementing The point is that you may do it programmatically, in

Re: [Interest] QRegularExpression for replace

2022-12-03 Thread Scott Bloom
022 8:14 PM To: interest@qt-project.org Subject: Re: [Interest] QRegularExpression for replace On Thursday, 1 December 2022 11:43:39 PST Scott Bloom wrote: > Im looking for a way using QRE to do something like the following > > auto regEx = QRegularExpression( "(?.*)" ); if

Re: [Interest] QRegularExpression for replace

2022-12-02 Thread Thiago Macieira
On Thursday, 1 December 2022 11:43:39 PST Scott Bloom wrote: > Im looking for a way using QRE to do something like the following > > auto regEx = QRegularExpression( "(?.*)" ); > if ( regEx.match( string ) ) > auto newString = regEx.replace( string, "${name}" ); This requires havi

Re: [Interest] QRegularExpression for replace

2022-12-01 Thread Tony Rietwyk
On 2/12/2022 6:43 am, Scott Bloom wrote: Im looking for a way using QRE to do something like the following auto regEx = QRegularExpression( “(?.*)” ); if ( regEx.match( string ) )     auto newString = regEx.replace( string, “${name}” ); Using the standard set of regex subsitution

[Interest] QRegularExpression for replace

2022-12-01 Thread Scott Bloom
Im looking for a way using QRE to do something like the following auto regEx = QRegularExpression( "(?.*)" ); if ( regEx.match( string ) ) auto newString = regEx.replace( string, "${name}" ); Using the standard set of regex subsitutions Is this something anyone is looking at? Or

Re: [Interest] QRegularExpression

2013-10-29 Thread Thiago Macieira
On terça-feira, 29 de outubro de 2013 10:55:00, Bob Hood wrote: > On 10/29/2013 9:20 AM, Thiago Macieira wrote: > > This misses the point of using QRegularExpression... > > Just showing him how. He didn't ask what the point would be. ;) Well, you used QRegExp, not QRegularExpression. The code f

Re: [Interest] QRegularExpression

2013-10-29 Thread Bob Hood
On 10/29/2013 9:20 AM, Thiago Macieira wrote: > On terça-feira, 29 de outubro de 2013 06:16:04, Bob Hood wrote: >> On 10/29/2013 3:17 AM, Graham Labdon wrote: >>> Hi >>> Is it possible to use QRegularExpression to perform search and replace on >>> a >>> string? >>> I know I can use QString::replace

Re: [Interest] QRegularExpression

2013-10-29 Thread Thiago Macieira
On terça-feira, 29 de outubro de 2013 06:16:04, Bob Hood wrote: > On 10/29/2013 3:17 AM, Graham Labdon wrote: > > Hi > > Is it possible to use QRegularExpression to perform search and replace on > > a > > string? > > I know I can use QString::replace and pass a regular expression, but > > wanted >

Re: [Interest] QRegularExpression

2013-10-29 Thread Bob Hood
On 10/29/2013 3:17 AM, Graham Labdon wrote: > Hi > Is it possible to use QRegularExpression to perform search and replace on a > string? > I know I can use QString::replace and pass a regular expression, but wanted > to know if it's possible (and how) using just QRegularExpression Sure: QStri

[Interest] QRegularExpression

2013-10-29 Thread Graham Labdon
Hi Is it possible to use QRegularExpression to perform search and replace on a string? I know I can use QString::replace and pass a regular expression, but wanted to know if it's possible (and how) using just QRegularExpression Thanks ___ Interest ma