Android Question about base64

TILogistic

Expert
Licensed User
Longtime User
How to distinguish a string that conforms to the Base64 specification in B4A?
B4X:
Public Sub IsValid(Data As String) As Boolean
    Dim Pattern As String = "^(?:[A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$"
    Return Regex.IsMatch(Pattern, Data)
End Sub


Note: base64 can be base64-safe

see:

 
Last edited:
Upvote 0
Top