Search a buffer for a certain string.
Source position: strutils.pp line 128
function SearchBuf( |
Buf: PAnsiChar; |
BufLen: SizeInt; |
SelStart: SizeInt; |
SelLength: SizeInt; |
SearchString: string; |
Options: TStringSearchOptions |
):PAnsiChar; |
Buf: PAnsiChar; |
BufLen: SizeInt; |
SelStart: SizeInt; |
SelLength: SizeInt; |
SearchString: string |
):PAnsiChar; |
Buf |
|
Buffer to search. |
BufLen |
|
Length of the buffer. |
SelStart |
|
Start of selection. |
SelLength |
|
Length of selection. |
SearchString |
|
String to search for. |
Position of the string, nil if not found.
Buf |
|
Buffer to search. |
BufLen |
|
Length of the buffer. |
SelStart |
|
Start of selection. |
SelLength |
|
Length of selection. |
SearchString |
|
String to search for. |
SearchBuf searches the buffer Buf for the occurrence of SearchString. At most Buflen characters are searched, and the search is started at at SelStart when searching (up, the default), but starts at SelStart+SelLength when searching backward (the soDown option is given). If a match is found, a pointer to the position of the match is returned. SelStart is a zero-based offset from Buf and is the lower bound for search operations. The parameter Options specifies how the search is conducted. It is a set of the following options:
| Option | Effect |
|---|---|
| soDown | Searches backward, starting at the end of the selection. Default is searching up. |
| soMatchCase | Observe case when searching. Default is to ignore case. |
| soWholeWord | Match only whole words. Default also returns parts of words. |
The standard constant WordDelimiters is used to mark the boundaries of words.
The SelStart parameter is zero based.
Buflen must be the real length of the string, no checking on this is performed.
|
Search for a substring in a string, using wildcards. |
|
|
Extract the N-th word out of a string. |
|
|
Extract a word from a string, and return the position where it was located in the string. |
|
|
Extract a word from a string, starting at a given position in the string. |
|
|
Check for the presence of a word in a string. |