Android Question Regular Expression splitting String at "|"

walterf25

Expert
Licensed User
Longtime User
Hello all, i was wondering if anyone had any suggestions on an issue i'm having, i need to split a response from a server at this character "|".

The response from the server looks like this


I've tried this code:

B4X:
Dim response() as string
response = RegEx.Split("|", Job.GetString)

the expected split string should be the following...
response(0) should be timestamp (epochtime) and
response(1) should be the URL

but i'm not getting that response, i'm assuming that's because the PIPE character "|" is a reserved charcter in the Regular Expressions.
Is there a way to go around this problem, does anyone have any suggestion, it is really late here, so i might just be chasing my own tale, any suggestions will be greatly appreciated.

Thanks,
Walter
 

walterf25

Expert
Licensed User
Longtime User
Just to add to Erel's answer the slash is what is known as an escape character in case you are curious as to how it works.
Thanks for that info CidTek, i did not know that.

Walter
 
Upvote 0
Top