Use QString to retrieve data from regular expression
-
This code removes all matching the expression
result = source.remove(QRegularExpression (expression));
I need the opposite - retrieve all matching the expression - using QString.
I did look thru QSiring doc and cannot figure out which function would accomplish my task...I did try append and getting this error - so passing QString to "append" is no good...
/mnt/MDI_RAID_5/MDI_WORK_COPY_FOLDER/MDI_BT_Aug14_BASE/MDI_BT/MDI_BT/C_BLUETOOTHCTL/C_bluetoothctl/mainwindow_bluetoothctl.cpp:6542: error: no matching function for call to ‘QString::append(QRegularExpression)’
mainwindow_bluetoothctl.cpp: In member function ‘QString MainWindow_Bluetoothctl::SubRegularExpressionExt(QString, QString, int)’:
mainwindow_bluetoothctl.cpp:6542:35: error: no matching function for call to ‘QString::append(QRegularExpression)’
6542 | result = source.append(QRegularExpression (expression));
| ~~~~~~~~~~~~~~~~~~~~~^ -
Use QRegularExpression::match() and iterate over your string with this.
-
Just figured that also...
Does the job.
Thanks for the quick response I appreciate that.SOLVED