Imports System
Imports uCalcSoftware
Public Module Program
Public Sub Main()
Dim uc As New uCalc()
Dim t = uc.NewTransformer()
t.Str("
Title
Bold statementTitle B
Other textMy paragraph
")
'// ^ ^ ^ ^ ^
'// 012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
'// 0 10 20 30 40 50 60 70 80
'// Carrets (^) point to Start locations of the matches
Dim AnyOtherTag = t.Pattern("<{tag}>{text}{tag}>")
Dim BoldTag = t.Pattern("{text}")
Dim H3Tag = t.Pattern("{text}
")
t.Find()
Console.WriteLine("IndexOf StartPos Match")
Console.WriteLine("")
Console.WriteLine("All Matches")
Console.WriteLine("-----------")
For Each match In t.Matches
Console.WriteLine($"{t.Matches.IndexOf(match.StartPosition)} {match.StartPosition} {match.Text}")
Next
Console.WriteLine("")
Console.WriteLine("Bold Matches")
Console.WriteLine("------------")
For Each BoldMatch In BoldTag.Matches
Console.WriteLine($"{t.Matches.IndexOf(BoldMatch.StartPosition)} {BoldMatch.StartPosition} {BoldMatch.Text}")
Next
Console.WriteLine("")
Console.WriteLine("H3 Matches")
Console.WriteLine("----------")
For Each H3Match In H3Tag.Matches
Console.WriteLine($"{t.Matches.IndexOf(H3Match.StartPosition)} {H3Match.StartPosition} {H3Match.Text}")
Next
Console.WriteLine("")
Console.WriteLine("Other Matches")
Console.WriteLine("-------------")
For Each AnyOtherMatch In AnyOtherTag.Matches
Console.WriteLine($"{t.Matches.IndexOf(AnyOtherMatch.StartPosition)} {AnyOtherMatch.StartPosition} {AnyOtherMatch.Text}")
Next
End Sub
End Module