B4J Question Regex.Split problem

Tayfur

Well-Known Member
Licensed User
Longtime User
I cant understand.
Why regex cant split "." / POINT


B4X:
Dim d() As String
    d=Regex.Split(".","192.168.1.31")
    Log(d.Length)
'************
' RETURN : 0
'***********

B4X:
Dim d() As String
    d=Regex.Split(",","192,168,1,31")
    Log(d.Length)
'************
' RETURN : 4
'***********
 

manuel-r

Member
Licensed User
Longtime User
"." ist one of some reserved characters that have functions in regex-definitions. If you want to split by these characters you have to mask them with "\".
B4X:
regex.split("\.","a.b.c.d.e.f.g")
 
Upvote 0

Tayfur

Well-Known Member
Licensed User
Longtime User
"." ist one of some reserved characters that have functions in regex-definitions. If you want to split by these characters you have to mask them with "\".
B4X:
regex.split("\.","a.b.c.d.e.f.g")
@manuel-r Thank you for helps.

@Erel could you add in info/helps like this special informations. After IDE can be more perfect.

Untitled.jpg
 
Upvote 0

Mark Read

Well-Known Member
Licensed User
Longtime User
Or try playing here for example but activate the cheat sheet so you can see the commands.
 
Upvote 0
Top