Character Search Functions

and Methods

Alpha Five provides the following character search functions and methods.

Function

 

Type

Description

$

V5

L

Determines whether the character expression on the left of the operator is contained anywhere within the character expression on the right.

*ANY()

V5

L

Returns .T. (TRUE) if Find_String is found anywhere in Search_In_String. Case-sensitive.

*FIRST()

V5

L

Returns .T. (TRUE) if Find_String is found at the start of Search_In_String. Case-sensitive.

*LEADING()

V5

L

Returns .T. (TRUE) if Find_String matches the first part of any word in Search_In_String. Case-sensitive.

*WORD()

V5

L

Returns .T. (TRUE) if Find_String is a whole word in Search_In_String. Case-sensitive.

*WORDI()

V5

L

Returns true (.T.) if the Find_String is found in the Search_In_String. Case-insensitive.

AT()

V5

N

Returns the position of the n th occurrence of the Find_String within the specified Search_In_String, where n is specified through the Number argument. Case-sensitive.

A5_EXTRACT_ADVANCE()

V6

C

Finds and returns the text between two character strings, optionally including the two character strings.

AT2()

V5

N

Returns the position of Find_String within the specified Search_In_String, or the location from which to begin the next search.

ATC()

V5

N

Returns the position of the n th occurrence of the Find_String within the specified Search_In_String, where n is specified through the Number argument. Case-insensitive.

IS_ONE_OF()

V5

L

Determines whether an character string is a member of a list.

LEN()

V5

N

Returns an integer equal to the number of characters in the Input_String.

POS_FROM_

WORD_NUMBER()

V5

N

Returns the position of the first character of the entry specified by Entry_Number in the Search_List.

RAT()

V5

N

Returns the position of the n th occurrence of the Find_String from the end of the specified Search_In_String ; where n is specified through the Number argument.

REGEX_MATCH()

V6

L

Searches Text for a match to Search_Expresssion returns .T. (TRUE) or .F. (FALSE).

REGEX_SPLIT()

V6

C

Searches Text for one or more matches to Search_Expresssion and returns each matching string on its own line.

SMATCH()

V5

L

Returns .T. if Find_String is found in Search_in_String.

SMATCH_MEMO()

V5

L

Returns .T. if Find_String is found in the memo field Search_in_Field.

TEXTSEARCH()

V5

L

Returns .T. (TRUE) if Find_String string is found in Search_In_String. Find_String can contain the reserved Boolean words .and. and .or..

TEXTSEARCHSCORE()

V5

N

Returns the number of phrases in Find_String found in Search_In_String as a percentage. Search is case insensitive.

WORD_EXISTS()

V5

L

Returns .T. if Word is found in the CR-LF delimited List.

WORD_FROM_POS()

V5

N

Converts the position in a text string to the number of the word in the text string.

WORD_NUM()

V5

N

Returns the position of a word or entry in a CR-LF delimited list.

WORD_NUMBER_GET()

V5

N

Returns the integer list position of the Find_String in the Search_In_String.

WORDAT()

V5

N

Returns the word number of Word in Input_String. Case insensitive.

WORDATC()

V5

N

Returns the word number of Word in Input_String.  Case sensitive.

WORDS()

V5

N

Returns Word_Count of words from Input_String, starting with the word identified by Word_Number.

Precede the following methods with a pointer to a StringScanner object. Create the pointer with StringScanner.Create().

Method

 

Type

Description

.ScanOverSmatch()

V7

C

Looks for Find_Text at the offset and returns the text between the starting and ending positions. Uses wildcard characters.

.ScanOverSmatchI()

V7

C

Looks for Find_Text (case insensitive) at the offset and returns the text between the starting and ending positions. Uses wildcard characters.

.ScanSmatch()

V7

L

Indicates whether the Find_Text can be between the offset and the end of the buffer.

.ScanSmatchI()

V7

L

Indicates whether the Find_Text (case insensitive) can be between the offset and the end of the buffer.

.ScanToAlpha()

V7

C

Positions the offset after the next alphabetic character and returns the text between the starting and ending positions of the offset.

.ScanToAlphaNum()

V7

C

Positions the offset after the next alphanumeric character and returns the text between the starting and ending positions of the offset.

.ScanToCharacter()

V7

C

Moves the offset forward until it finds a character not in Find_Chars and returns the text between the starting and ending positions of the offset.

.ScanToDigit()

V7

C

Positions the offset after the next number (0 to 9) that it finds and returns the text between the starting and ending positions of the offset.

.ScanToSmatch()

V7

C

Positions the offset after the next instance of the search argument. Uses wildcard characters.

.ScanToSmatchI()

V7

C

Positions the offset after the next instance of the search argument (case insensitive). Uses wildcard characters.

.ScanToString()

V7

C

Positions the offset after the next instance of the Find_Text and returns the text between the starting and ending positions of the offset.

.ScanToStringI()

V7

C

Positions the offset after the next instance of the Find_Text (case insensitive) and returns the text between the starting and ending positions of the offset.

.ScanToToken()

V7

 

Moves the offset to the indicated Kind of token.

.ScanTypedToken()

V7

C

Returns the next Token_Found in the format Kind : Token.

.ScanToWhitespace()

V7

C

Positions the offset after the next whitespace character and returns the text between the starting and ending positions of the offset.

.SkipOverAlpha()

V7

N

Positions the offset after the next non-alpha character and returns the number of characters skipped.

.SkipOverAlphaNum()

V7

N

Positions the offset after the next non-alphanumeric character and returns the number of characters skipped.

.SkipOverCharacter()

V7

N

Positions the offset after the first character not in the group and returns the number of characters skipped over.

.SkipOverDigit()

V7

N

Positions the offset after the first non-numeric character and returns the number of characters skipped over.

.SkipOverSmatch()

V7

N

Positions the offset after the search text and returns the number of characters skipped over. Uses wildcard characters.

.SkipOverSmatchI()

V7

N

Positions the offset after the search text (case insensitive) and returns the number of characters skipped over. Uses wildcard characters.

.SkipOverString()

V7

N

Positions the offset at the beginning of the search text and returns the number of characters skipped over.

.SkipOverStringI()

V7

N

Positions the offset at the beginning of the search text (case insensitive) and returns the number of characters skipped over.

.SkipOverToken()

V7

C

Moves the offset to the next token of the specified type.

.SkipOverWhitespace()

V7

N

Positions the offset after the next non-whitespace character and returns the number of characters skipped.

.SkipToAlpha()

V7

L

Positions the offset at the beginning of the next alphabetic character and returns true if successful.

.SkipToAlphaNum()

V7

L

Positions the offset at the beginning of the next alphanumeric character and returns true if successful.

.SkipToCharacter()

V7

L

Positions the offset at the next characters in the search list and returns true if successful.

.SkipToDigit()

V7

L

Positions the offset at the next digit (0-9) is encountered and returns true if successful.

.SkipToString()

V7

L

Positions the offset at the beginning of the search text and returns true if successful.

.SkipToStringI()

V7

L

Positions the offset at the beginning of the search text (case insensitive) is found and returns true if successful.

.SkipToToken()

V7

L

Moves the offset to the position after the found token.

.SkipToWhitespace()

V7

L

Positions the offset at the next whitespace character and returns true if successful.

See Also

Character Functions, List Processing Functions, StringScanner