[SerializableAttribute]
[XmlRootAttribute("MatchPositionInfo")]
public struct MatchPositionInfo
<SerializableAttribute>
<XmlRootAttribute("MatchPositionInfo")>
Public Structure MatchPositionInfo
Dim instance As MatchPositionInfo
[SerializableAttribute]
[XmlRootAttribute(L"MatchPositionInfo")]
public value class MatchPositionInfo
[<SealedAttribute>]
[<SerializableAttribute>]
[<XmlRootAttribute("MatchPositionInfo")>]
type MatchPositionInfo =
struct
inherit ValueType
end
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
Sub Test()
Dim regExpr As New Regex("Dog(s)?", RegexOptions.IgnoreCase)
Dim text As String = "One Dog!, Two Dogs!, three Dogs!"
RichTextBox1.Text = text
Dim matchesPos As IEnumerable(Of MatchPositionInfo) = GetMatchesPositions(regExpr, text, groupIndex:=0)
For Each matchPos As MatchPositionInfo In matchesPos
Console.WriteLine(text.Substring(matchPos.StartIndex, matchPos.Length))
With RichTextBox1
.SelectionStart = matchPos.StartIndex
.SelectionLength = matchPos.Length
.SelectionBackColor = Color.IndianRed
.SelectionColor = Color.WhiteSmoke
.SelectionFont = New Font(RichTextBox1.Font.Name, RichTextBox1.Font.SizeInPoints, FontStyle.Bold)
End With
Next matchPos
With RichTextBox1
.SelectionStart = 0
.SelectionLength = 0
End With
End Sub
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
MatchPositionInfo | Initializes a new instance of the MatchPositionInfo structure. |
EndIndex | Gets the end index. |
Length | Gets the matched text length. |
StartIndex | Gets the start index. |
Text | Gets the text value. |
Equals | Indicates whether this instance and a specified object are equal. (Inherited from ValueType) |
GetHashCode | Returns the hash code for this instance. (Inherited from ValueType) |
GetType | Gets the Type of the current instance. (Inherited from Object) |
CanConvertTo |
Determines whether the source object can be converted to the specified target type.
(Defined by ObjectExtensions) |
CanConvertToT |
Determines whether the source object can be converted to the specified target type.
(Defined by ObjectExtensions) |
ConvertToT |
Converts an object to the specified target type.
If the conversion fails, an exception is thrown.
(Defined by ObjectExtensions) |
ConvertToT |
Converts an object to the specified target type.
If the conversion fails, returns the specified default value.
(Defined by ObjectExtensions) |
IsDisposable |
Determines whether the specified object is a disposable type
(i.e., it implements IDisposable interface).
(Defined by ObjectExtensions) |
Speak |
Speaks the string representation of the source object by using the
operating system integrated text-to-speech synthesizer.
(Defined by ObjectExtensions) |
Speak |
Speaks the string representation of the source object by using the
operating system integrated text-to-speech synthesizer.
(Defined by ObjectExtensions) |
ThrowIfNullTException |
Throws the specified exception if the source object is null.
(Defined by ObjectExtensions) |