Collapse All Expand All Code: All Code: Multiple Code: C# Code: Visual Basic

C#
Visual Basic

Azuki 1.7 Documentation
Document..::..FindPrev Method (Regex, Int32, Int32)
Document Class See Also Send Feedback

Finds a text pattern backward by regular expression.

Namespace: Sgry.Azuki
Assembly: Azuki (in Azuki.dll) Version: 1.7.13.40248

# Syntax

C#
    public SearchResult FindPrev(
    	Regex regex,
    	int begin,
    	int end
    )

Visual Basic
    Public Function FindPrev (
    	regex As Regex,
    	begin As Integer,
    	end As Integer
    ) As SearchResult

#### Parameters

regex
  Type: System.Text.RegularExpressions..::..Regex
  A Regex object expressing the text pattern.

begin
  Type: System..::..Int32
  The begin index of the search range.

end
  Type: System..::..Int32
  The end index of the search range.

#### Return Value

Type: SearchResult
Search result object if found, otherwise null if not found.

# Remarks

This method finds the last occurrence of a pattern expressed by a regular expression in the range of [begin, end). The text matching process continues for the index specified with the begin parameter and does not stop at line ends nor null-characters.

RegexOptions.RightToLeft option MUST be set to the Regex object given as parameter regex otherwise an ArgumentException will be thrown.

If an empty string was used for a regular expression pattern, search result will be a range of [end, end).

# Exceptions

Exception | Condition
--- | ---
System..::..ArgumentException | Parameter regex is a Regex object without RegexOptions.RightToLeft option.
System..::..ArgumentNullException | Parameter regex is null.
System..::..ArgumentOutOfRangeException | Parameter begin or end is out of valid range.

# See Also

Document Class
Document..::..Document Members
FindPrev Overload
Sgry.Azuki Namespace