用java正则表达式的程序中,怎么输入含有换行的大量文本数据?
在如下程序的Strings1="“;的右边括号里,不能一次粘贴进含有换行的大量的文本数据!我想将文华期货数据转入飞狐交易师。packagepackage1;publicc...
在如下程序的 String s1 = " “;的右边括号里,不能一次粘贴进含有换行的大量的文本数据!我想将文华期货数据转入飞狐交易师。
package package1;
public class Whzfh {
public static void main(String[] args){
String s1 = "09/30/2013,3586,3598,3581,3587,3588,648414,1384192";
s1 = s1.replaceAll(","," ");
System.out.println(s1);
s1 = s1.replaceAll("^(\\d{2})/(\\d{2})/(\\d{4})","$3$1$2");
System.out.println(s1);
s1 = s1.replaceAll("^((\\d+ ){4})(\\d+)( \\d+ )(\\d+ \\d+)","$1$3 $5");
System.out.println(s1);
}
} 展开
package package1;
public class Whzfh {
public static void main(String[] args){
String s1 = "09/30/2013,3586,3598,3581,3587,3588,648414,1384192";
s1 = s1.replaceAll(","," ");
System.out.println(s1);
s1 = s1.replaceAll("^(\\d{2})/(\\d{2})/(\\d{4})","$3$1$2");
System.out.println(s1);
s1 = s1.replaceAll("^((\\d+ ){4})(\\d+)( \\d+ )(\\d+ \\d+)","$1$3 $5");
System.out.println(s1);
}
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询