From 802391bafca9efff2c41fbc31e54f309479ccdea Mon Sep 17 00:00:00 2001
From: Neil Last edited 2 October 2014 NH Last edited 16 October 2014 NH There is an overview of the internal design of
Scintilla.
- There are methods to search for text and for regular expressions. The base regular expression support
+ There are methods to search for text and for regular expressions.
+ Most applications should use
+
+ as the basis for their search implementations.
+ Other calls augment this or were implemented before
+ The base regular expression support
is limited and should only be used for simple cases and initial development.
When using a C++11 compliant compiler and runtime, it may be possible to use the
runtime's implementation of <regex> by compiling Scintilla with Regular expressions will only match ranges within a single line, never matching over multiple lines. SCI_FINDTEXT(int searchFlags, Sci_TextToFind *ttf) You can
+ search backwards to find the previous occurrence of a search string by setting the end of the
+ search range before the start. The See also: ,
Using ,
- modifications cause scrolling and other visible changes, which may take some time and cause
- unwanted display updates. If performing many changes, such as a replace all command, the target
- can be used instead. First, set the target, ie. the range to be replaced. Then call
- Searching can be performed within the target range with SCI_SETTARGETSTART(int pos) SCI_TARGETFROMSELECTION SCI_SETSEARCHFLAGS(int searchFlags) SCI_SEARCHINTARGET(int length, const char *text) SCI_REPLACETARGET(int length, const char *text) SCI_REPLACETARGETRE(int length, const char *text) SCI_GETTAG(int tagNumber, char *tagValue) See also: SCI_SETOVERTYPE(bool overType) SCI_EXPANDCHILDREN(int line, int level)Scintilla Documentation
-
@@ -606,7 +606,14 @@ struct Sci_TextRange {
Searching
SCI_SEARCHINTARGET.
+ CXX11_REGEX defined.
@@ -615,17 +622,81 @@ struct Sci_TextRange {
or can be called from the container using direct access to the buffer contents through
.
-
-
@@ -774,12 +841,25 @@ struct Sci_TextRange {
-
+
+
+
+
+
This message searches for text in the document. It does not use or move the current selection.
The searchFlags argument controls the
search type, which includes regular expression searches.Sci_TextToFind structure is defined in Scintilla.h; set
chrg.cpMin and chrg.cpMax with the range of positions in the document
to search. You can search backwards by
@@ -832,89 +912,6 @@ struct Sci_TextToFind {
Search and replace using the target
-
- SCI_REPLACETARGET or SCI_REPLACETARGETRE.SCI_SEARCHINTARGET,
- which uses a counted string to allow searching for null characters. It returns the
- position of the start of the matching text range or -1 for failure, in which case the target is not moved. The flags used by
- SCI_SEARCHINTARGET such as SCFIND_MATCHCASE,
- SCFIND_WHOLEWORD, SCFIND_WORDSTART, and SCFIND_REGEXP
- can be set with SCI_SETSEARCHFLAGS. SCI_SEARCHINTARGET may be simpler
- for some clients to use than , as that requires using a pointer to a
- structure.
-
-
-
-
-
-
-
-
-
-
-
-
-
- SCI_GETTARGETSTART
- SCI_SETTARGETEND(int pos)
- SCI_GETTARGETEND
- These functions set and return the start and end of the target. When searching in non-regular
- expression mode, you can set start greater than end to find the last matching text in the
- target rather than the first matching text. The target is also set by a successful
- SCI_SEARCHINTARGET.
- Set the target start and end to the start and end positions of the selection.
- SCI_GETSEARCHFLAGS
- These get and set the searchFlags used by
- SCI_SEARCHINTARGET. There are several option flags including a simple regular
- expression search.
- This searches for the first occurrence of a text string in the target defined by
- SCI_SETTARGETSTART and SCI_SETTARGETEND. The text string is not zero
- terminated; the size is set by length. The search is modified by the search flags
- set by SCI_SETSEARCHFLAGS. If the search succeeds, the target is set to the found
- text and the return value is the position of the start of the matching text. If the search
- fails, the result is -1.
- If length is -1, text is a zero terminated string, otherwise
- length sets the number of character to replace the target with.
- After replacement, the target range refers to the replacement text.
- The return value
- is the length of the replacement string.
- Note that the recommended way to delete text in the document is to set the target to the text to be removed,
- and to perform a replace target with an empty string.
- This replaces the target using regular expressions. If length is -1,
- text is a zero terminated string, otherwise length is the number of
- characters to use. The replacement string is formed from the text string with any sequences of
- \1 through \9 replaced by tagged matches from the most recent regular
- expression search. \0 is replaced with all the matched text from the most recent search.
- After replacement, the target range refers to the replacement text.
- The return value is the length of the replacement string.
- Discover what text was matched by tagged expressions in a regular expression search.
- This is useful if the application wants to interpret the replacement string itself.Overtype
@@ -3181,6 +3178,7 @@ struct Sci_TextToFind {
Other settings
+
@@ -5539,7 +5537,6 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){
This is used to respond to a change to a line causing its fold level or whether it is a header to change,
@@ -7536,8 +7533,6 @@ EM_FORMATRANGE
Any use of these symbols should be removed and replaced with standard indicators.
SCI_GETSTYLEBITS and SCI_GETSTYLEBITSNEEDED always return 8,
indicating that 8 bits are used for styling and there are 256 styles.
-- cgit v1.2.3