我有一个这样的字符串:
06%2F27%2F2012%2C07%2F05%2F2012%2C06%2F29%2F2012%2C07%2F05%2F2012%2C07%2F06%2F2012%2C07%2F19%2F2012%2C07%2F06%2F2012%2C07%2F19%2F2012%2C07%2F05%2F2012%2C07%2F05%2F2012%2C07%2F20%2F2012%2C07%2F20%2F2012%2C07%2F27%2F2012%2C08%2F02%2F2012%2C07%2F20%2F2012%2C07%2F26%2F2012%2C08%2F03%2F2012%2C08%2F06%2F2012%2C08%2F06%2F2012%2C08%2F17%2F2012
我希望它像这样拆分它的值:
%2F should be /
%2C marks the starting of new string
所以价值观就像:
06/27/2012 , 07/052012 等
我尝试为此创建某种正则表达式,但没有成功。
我试过的例子:
String phrase = "06%2F27%2F2012%2C07%2F05%2F2012%2C06%2F29%2F2012%2C07%2F05%2F2012%2C07%2F06%2F2012%2C07%2F19%2F2012%2C07%2F06%2F2012%2C07%2F19%2F2012%2C07%2F05%2F2012%2C07%2F05%2F2012%2C07%2F20%2F2012%2C07%2F20%2F2012%2C07%2F27%2F2012%2C08%2F02%2F2012%2C07%2F20%2F2012%2C07%2F26%2F2012%2C08%2F03%2F2012%2C08%2F06%2F2012%2C08%2F06%2F2012%2C08%2F17%2F2012";
String delims = "REGEX_GOES_HERE";
String[] tokens = phrase.split(delims);