Click here to Skip to main content
15,895,011 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Struct initalization valid ? Pin
CPallini8-Nov-23 2:37
mveCPallini8-Nov-23 2:37 
AnswerRe: Struct initalization valid ? Pin
jschell8-Nov-23 6:01
jschell8-Nov-23 6:01 
AnswerRe: Struct initalization valid ? Pin
honey the codewitch8-Nov-23 10:03
mvahoney the codewitch8-Nov-23 10:03 
GeneralRe: Struct initalization valid ? Pin
k50548-Nov-23 12:31
mvek50548-Nov-23 12:31 
GeneralRe: Struct initalization valid ? Pin
honey the codewitch8-Nov-23 21:31
mvahoney the codewitch8-Nov-23 21:31 
GeneralRe: Struct initalization valid ? Pin
k50549-Nov-23 4:12
mvek50549-Nov-23 4:12 
GeneralRe: Struct initalization valid ? Pin
honey the codewitch9-Nov-23 4:51
mvahoney the codewitch9-Nov-23 4:51 
GeneralRe: Struct initalization valid ? Pin
k50549-Nov-23 6:49
mvek50549-Nov-23 6:49 
GeneralNot a question, just a lament about metaprogramming Pin
honey the codewitch28-Oct-23 22:19
mvahoney the codewitch28-Oct-23 22:19 
GeneralRe: Not a question, just a lament about metaprogramming Pin
jschell8-Nov-23 6:06
jschell8-Nov-23 6:06 
GeneralRe: Not a question, just a lament about metaprogramming Pin
honey the codewitch8-Nov-23 6:07
mvahoney the codewitch8-Nov-23 6:07 
GeneralRe: Not a question, just a lament about metaprogramming Pin
jschell9-Nov-23 7:03
jschell9-Nov-23 7:03 
GeneralRe: Not a question, just a lament about metaprogramming Pin
honey the codewitch9-Nov-23 7:10
mvahoney the codewitch9-Nov-23 7:10 
GeneralRe: Not a question, just a lament about metaprogramming Pin
jschell10-Nov-23 5:23
jschell10-Nov-23 5:23 
GeneralRe: Not a question, just a lament about metaprogramming Pin
honey the codewitch10-Nov-23 5:37
mvahoney the codewitch10-Nov-23 5:37 
GeneralRe: Not a question, just a lament about metaprogramming Pin
honey the codewitch8-Nov-23 6:17
mvahoney the codewitch8-Nov-23 6:17 
QuestionHow to extract all words - using regular expression Pin
Salvatore Terress26-Oct-23 6:35
Salvatore Terress26-Oct-23 6:35 
AnswerRe: How to extract all words - using regular expression Pin
k505426-Oct-23 7:21
mvek505426-Oct-23 7:21 
AnswerRe: How to extract all words - using regular expression Pin
Richard Andrew x6426-Oct-23 8:51
professionalRichard Andrew x6426-Oct-23 8:51 
AnswerRe: How to extract all words - using regular expression Pin
Richard MacCutchan26-Oct-23 22:16
mveRichard MacCutchan26-Oct-23 22:16 
GeneralRe: How to extract all words - using regular expression Pin
Salvatore Terress27-Oct-23 10:21
Salvatore Terress27-Oct-23 10:21 
GeneralRe: How to extract all words - using regular expression Pin
Richard MacCutchan27-Oct-23 22:13
mveRichard MacCutchan27-Oct-23 22:13 
AnswerRe: How to extract all words - using regular expression Pin
jschell27-Oct-23 10:11
jschell27-Oct-23 10:11 
GeneralRe: How to extract all words - using regular expression Pin
Salvatore Terress27-Oct-23 14:01
Salvatore Terress27-Oct-23 14:01 
GeneralRe: How to extract all words - using regular expression Pin
Salvatore Terress28-Oct-23 5:21
Salvatore Terress28-Oct-23 5:21 
Here is the actual snippet of the code.
I have "hard coded " the RegExp



C++
     // "[/\\w+/g]+"
        RegExp = "[/\\w+/g]+";
        text = " validate regular expression   ";
        text += RegExp;
        qDebug() << text;
        textDEBUG->append(text);

        // RegExp = "[/\\w+/g]+";
        text = " validate inString   ";
        text += inString;
        qDebug() << text;
        textDEBUG->append(text);


        QRegularExpression re(RegExp);


        // QRegularExpression re("/([A-Z])\w+/g");
//QRegularExpression re("([A-Z])\w+");

        QRegularExpressionMatch match = re.match(inString);

        if (match.hasMatch()) { // matches all
            text = " Has all match ";
            QStringList result = match.capturedTexts();

            text += result.at(0);    // test show only first

            qDebug() << text;
            textDEBUG->append(text);

            return result.at(0);



Here is the relevant debug output


"START EditLine_RegExp...QString BT_Utility_Library::EditLine_RegExp_Ext(QString, QString, QTextEdit *, QTextEdit *)1321"
" instring text  \t\n Waiting to connect to bluetoothd...\r\u001B[0;94m[bluetooth]\u001B[0m#                                                                              \r\r\u001B[0;94m[bluetooth]\u001B[0m# \r                        \rAgent registered\n\u001B[0;94m[bluetooth]\u001B[0m# "
" regular expression \t\n  (\\w+\\s:?)"
" validate regular expression   [/\\w+/g]+"
" validate inString   Waiting to connect to bluetoothd...\r\u001B[0;94m[bluetooth]\u001B[0m#                                                                              \r\r\u001B[0;94m[bluetooth]\u001B[0m# \r                        \rAgent registered\n\u001B[0;94m[bluetooth]\u001B[0m# "
" Has all match Waiting"
10:12:17: /mnt/RAID_124/BT/BT_Oct23_BASE_/mdi/MDI exited with code 0




The expression matches ONLY the first word it finds.
My goal is to match ALL the words in the inString.

I am going to try one of the AI reg exp generators, but from experience
using them this RegExp MAY work....

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.