Android Question Regex B4A & B4J

Mahares

Expert
Licensed User
Longtime User
B4A: 5 strings - "" "1" "2" "3" "4"
You never quit Mario. I quickly tested and it shows 4 elements in B4A
B4X:
Dim components() As String
    components = Regex.Split("", "1234")
    Log(components.Length)
    For i =0 To components.Length-1
        Log(components(i))
    Next
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
1701694405500.png
 
Upvote 0

Sagenut

Expert
Licensed User
Longtime User
I tested it too and I got 4 elements.
 
Upvote 0

Sagenut

Expert
Licensed User
Longtime User
Where Regex come from?
Is it included in Java JDK?
Could it be something related to the Java version?
@LucaMs which version of Java do you have in your path?
I tested with Open JDK 14 and 17.
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
@lucas, can you upload the project that produces this issue?
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
It has nothing to do with the JDK you're using, but Android's implementation of (java.util.regex.Pattern) (if it is an actual problem). Are you doing this on a real device? What Android version?

Links:
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
This may be related to this issue:

 
Upvote 0

Sagenut

Expert
Licensed User
Longtime User
This can be a really important information to think about if some user/client report a bug and we are not able to replicate it.
Something to remeber.
 
Upvote 0
Top