Sub CountMatches(text As String,pattern As String) As Int
Dim tmp_count As Int = 0
Dim Matcher1 As Matcher
Matcher1 = Regex.Matcher(pattern, text)
Do While Matcher1.Find
tmp_count = tmp_count +1
today my phone did not recognised my display pattern to unlock.
i had also finger sensor in use.
then i read i can input a new pin at pc in google account security settings and lock the phone.
but then the phone still want use the pattern and not the pin^^ and the finger print did not...