« FileMaker Meetings fo… | Home | Have you tried Auto C… »

Scintilla in Xojo with Search and Replace

Several people asked for this, so let us add a search feature to our example project. Beside of using ScintillaControlMBS control to show HTML, MySQL or Xojo code, the example now includes a find and replace window:

In Scintilla you not just have a current selection (actually multiple), but also a target range. The target range is used to search and replace text without the user seeing this. We also have a FindText() function to perform a search and return the range where text is found. So you can search and show it in user interface.

Search can be done with various flags:

kFindOptionNoneDefault setting is case-insensitive literal match.
kFindOptionMatchCaseA match only occurs with text that matches the case of the search string.
kFindOptionWholeWordA match only occurs if the characters before and after are not word characters as defined by WordChars property.
kFindOptionWordStartA match only occurs if the character before is not a word character as defined by WordChars property.
kFindOptionRegExpThe search string should be interpreted as a regular expression. Uses Scintilla's base implementation unless combined with kFindOptionCxx11RegEx to use C++11 version.

When Regular expressions are enabled, you can use the familiar syntax and use \0, \1, \2 and so on in replacement to reference the Nth captured value.

Please try this in the next pre-release.
26 02 22 - 11:01