regex Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
Wolfgang
I live to help wx-kind
I live to help wx-kind
Posts: 180
Joined: Mon Jan 28, 2019 8:22 am

regex

Post by Wolfgang »

Hello Can somebody help me.

Code: Select all

wxString addTildeOptions(wxString searchText) {
wxRegEx mynew(_T("[aáàäâã]"),wxRE_BASIC);

                     mynew.ReplaceAll(&searchText, _T("\\[aáàäâã\\]"))
           //          searchText.ReplaceAll("[eéèëê]", "\\[eéèëê\\]")
             //        searchText.replaceAll("[iíìî]", "\\[iíìî\\]")
               //      searchText.replaceAll("[oóòöôõ]", "\\[oóòöôõ\\]")
                 //    searchText.replaceAll("[uúùüû]", "\\[uúùüû\\]")
                     searchText.replace("*", "[*]")
                     searchText.replace("?", "[?]");
                         return searchText.LowerCase()
}
Gives me:
error: expected ';' before 'searchText
in the line of

Code: Select all

mynew.ReplaceAll(&searchText, _T("\\[aáàäâã\\]"))
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4193
Joined: Sun Jan 03, 2010 5:45 pm

Re: regex

Post by PB »

The error message already tells you what is wrong: you are missing a semicolon at the end of that line.

And not only there but also at the line with the asterisk and with the return statement.
Wolfgang
I live to help wx-kind
I live to help wx-kind
Posts: 180
Joined: Mon Jan 28, 2019 8:22 am

Re: regex

Post by Wolfgang »

Overlooked that, totally. But it should show it in the next line. as error.
Happened because I copied java code from a website into it, and wanted to convert it, but then i did not check the ";"
Post Reply