This sub searches for matches and uses CSBuilder to mark the matches.
Usage example:

B4X:
Sub MarkPattern(Input As String, Pattern As String, GroupNumber As Int) As CSBuilder
Dim cs As CSBuilder
cs.Initialize
Dim lastMatchEnd As Int = 0
Dim m As Matcher = Regex.Matcher(Pattern, Input)
Do While m.Find
Dim currentStart As Int = m.GetStart(GroupNumber)
cs.Append(Input.SubString2(lastMatchEnd, currentStart))
lastMatchEnd = m.GetEnd(GroupNumber)
'apply styling here
cs.Bold.Underline
cs.Color(0xFF03FFFF)
cs.Clickable("cs", m.Group(GroupNumber))
cs.Append(m.Group(GroupNumber))
cs.Pop.Pop.Pop.Pop 'number should match number of stylings set.
Loop
If lastMatchEnd < Input.Length Then cs.Append(Input.SubString(lastMatchEnd))
Return cs
End Sub
B4X:
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("1")
Dim s As String = $"#Hello, this is a #Nice Day!
#nice test#test
#day"$
Dim cs As CSBuilder = MarkPattern(s, "\B(#\w+)\b", 1)
Label1.Text = cs
cs.EnableClickEvents(Label1)
End Sub
Sub cs_Click (Tag As Object)
Log($"You have clicked on word: ${Tag}"$)
Activity.Title = Tag
End Sub