Thanks for your reply, but i have a little problem, in my case, i have to catch only string <!-- --> inside a whole source code of webpage and ignore another character outside of <!-- and -->
Here is another version of it... This can find more than one in a complete source...
Have fun with it ;-)
B4X:
search = "some useless other text... <!-- try --> some useless other text... <!-- to --> some useless other text... <!-- find --> some useless other text... <!-- more... -->"
Dim result(99) As String
Dim answer As List
answer.Initialize
Dim M As Matcher
M = Regex.Matcher("(<!--).*(-->)",String1) 'String1 is the text you are searching
Do While M.Find
i = i + 1
result(i) = M.Match.Replace("<!--", "").Replace("-->", "")
answer.Add(result(i))
Loop