Page 1 of 1

regex

Posted: Sun Apr 12, 2020 7:36 am
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áàäâã\\]"))

Re: regex

Posted: Sun Apr 12, 2020 8:19 am
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.

Re: regex

Posted: Sun Apr 12, 2020 8:32 am
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 ";"