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( “(?<name>.*)” );

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 is there a solution outthere?

Scott

Hi Scott,

I have no idea what 'the standard set of regex substitutions' are, but have you seen QString replace(const QRegularExpression &re, const QString &after) ?

It supports capturing groups in the after string as well.

Hope that helps,

Tony

_______________________________________________
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest

Reply via email to