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: 174
Joined: Mon Jan 28, 2019 8:22 am

regex

Post by Wolfgang » Sun Apr 12, 2020 7:36 am

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: 2676
Joined: Sun Jan 03, 2010 5:45 pm

Re: regex

Post by PB » Sun Apr 12, 2020 8:19 am

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: 174
Joined: Mon Jan 28, 2019 8:22 am

Re: regex

Post by Wolfgang » Sun Apr 12, 2020 8:32 am

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