I am new to android development. And now i am struck with a regex pattern. I had tried many things but in vain.
I am trying to find the java equivalent of the regular expression "r'\^\d+\~[A-Za-z~ ]+'" which is written in python.
Thanks in advance
Edit:
Actually I want to parse the string :
"0~XYZ~Xamp Vampire~XMP~Vampire Cenet~~2013-7-9-16-39-25~~~~^12345~VAMPIRE CITY~Vampire City~VMC~Vampire Center~VPC~Xamp Center~XMPC~Xamper VC~XMVX~07.50~09.45~01.55~1111111~~~~~~~~0001001000~~~~~~~~~~~MAIL_EXPRESS~4640~1~0~0~2013-07-08~2018-07-08~84~43~MAIL_EXPRESS:84:1085,1085,675,0,575,0:650,650,415,315,355,965:460,460,295,260,250,720:245,245,165,100,145,345:280,280,190,0,165,0:135,135,90,90,80,170:55,45,40,10,35,45:0,0,0,0,0,0:40,30,40,0,40,40~0~0~~60~1~6303~~~Intercity Express~~1~SR~~BG~~~10010~,,En:,,GS:,,GSLRD:,,GS:,,2S:,,2S:,,2S:,,2S:D,D1,2S:C,C1,CC:,,2S:,,2S:,,2S:,,2S:,,2S:,,2S:,,2S:,,2S:,,2S:,,GSLR:~0~"
I wrote the regex in python as reg1=re.compile(r'\^\d+\~[A-Za-z~ ]+') and it gives me a result as ['^12345~VAMPIRE CITY~Vampire City~VMC~Vampire Center~VPC~Xamp Center~XMPC~Xamper VC~XMVX~'] as an array. I just want to reproduce this in java. I tried many combinations and what npinti suggests, but failed. Please help.