K Kiran Raotole Active Member Licensed User Jun 5, 2019 #1 My string = "AND051" How extract number from this string? like new variable = 051 / 51
Erel Administrator Staff member Licensed User Jun 5, 2019 #2 B4X: Dim s As String = "AND051" Dim m As Matcher = Regex.Matcher("\d+", s) If m.Find Then Dim number As Int = m.Match Log(number) End If
B4X: Dim s As String = "AND051" Dim m As Matcher = Regex.Matcher("\d+", s) If m.Find Then Dim number As Int = m.Match Log(number) End If
E emexes Expert Licensed User Jun 5, 2019 #3 https://regex101.com/ is good for exploring regular expressions (and for building them, too ;-) eg:
Erel Administrator Staff member Licensed User Jun 6, 2019 #4 Less polished but also useful: https://b4x.com:51041/regex_ws/index.html
E emexes Expert Licensed User Jun 6, 2019 #5 Erel said: Less polished but also useful Click to expand... I like that it provides the code.