Dim s As String = "AT+CUSD=1,""*388#"",15 OK +CUSD: 0,""PulsaUTAMA Rp.3375. Aktif 01/12/16, Tenggang 31/12/16,SMSHarian 0 ke ISAT& 0 SMS ke Opr lain.Eklusif Arsenal+grts tlp 1jm,hub *465*4#"",64"
Dim p As String = "PulsaUTAMA\s+Rp\.(?<balance>\d+)\.\s*Aktif\s*(?<date1>[\d/]+),\s*Tenggang\s*(?<date2>[\d/]+)"
Dim res As Match = Regex.Match(s, p)
If res.Success Then
Console.WriteLine(res.Groups("balance").Value)
Console.WriteLine(res.Groups("date1").Value)
Console.WriteLine(res.Groups("date2").Value)
End If
1条答案
按热度按时间rkttyhzu1#
这是来自@Wiktor Stribińew的代码,运行良好。