peacemaker Expert Licensed User Longtime User Jul 25, 2019 #1 HI, All Before update to B4A 9.30 this sub worked OK: B4X: Sub IfFormattedQR (text As String) As Boolean Dim res As Boolean = Regex.IsMatch("\d{4,}", text) Return res End Sub Strings like "TEST0000", "TEST9999"... were matched OK, as on https://regex101.com After update to B4A v.9.30 ... it's a miracle - do not match anymore. Always at jdk-11.0.1. Am i ill ?
HI, All Before update to B4A 9.30 this sub worked OK: B4X: Sub IfFormattedQR (text As String) As Boolean Dim res As Boolean = Regex.IsMatch("\d{4,}", text) Return res End Sub Strings like "TEST0000", "TEST9999"... were matched OK, as on https://regex101.com After update to B4A v.9.30 ... it's a miracle - do not match anymore. Always at jdk-11.0.1. Am i ill ?
Erel B4X founder Staff member Licensed User Longtime User Jul 26, 2019 #2 TEST0000 is not a match for \d{4,}. 0000 is a match. You can change the pattern to \w*\d{4,} or use Regex.Matcher instead of Regex.IsMatch. Upvote 0
TEST0000 is not a match for \d{4,}. 0000 is a match. You can change the pattern to \w*\d{4,} or use Regex.Matcher instead of Regex.IsMatch.
peacemaker Expert Licensed User Longtime User Jul 26, 2019 #3 Thanks, Erel, but.... before at https://regex101.com and in code it was matched, i remember... But "\w*\d{4,}\w*" works now, thanks. Upvote 0
Thanks, Erel, but.... before at https://regex101.com and in code it was matched, i remember... But "\w*\d{4,}\w*" works now, thanks.
DonManfred Expert Licensed User Longtime User Jul 26, 2019 #4 peacemaker said: before at https://regex101.com and in code it was matched, i remember... Click to expand... i tried it. With the defaults it does not match. If you change the site to use a matcher then it works. Last edited: Jul 26, 2019 Upvote 0
peacemaker said: before at https://regex101.com and in code it was matched, i remember... Click to expand... i tried it. With the defaults it does not match. If you change the site to use a matcher then it works.
Erel B4X founder Staff member Licensed User Longtime User Jul 26, 2019 #5 The code from the first post will not "work" (return true from TEST0000) with any version of B4A. You can try it. It cannot "work" because TEST0000 doesn't match the pattern. Upvote 0
The code from the first post will not "work" (return true from TEST0000) with any version of B4A. You can try it. It cannot "work" because TEST0000 doesn't match the pattern.