tools

package com.bailian.util;

import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class TextParser {

private static final String D8 = "\\d{8}\\D";

private static String ASC;

private static String DES;

static {
StringBuilder ascBuilder = new StringBuilder();
for(int i = 48; i < 58; i++) {
ascBuilder.append(Character.toChars(i));
}
ASC = ascBuilder.toString();
StringBuilder desBuilder = new StringBuilder();
for(int i = 57; i > 47; i--) {
desBuilder.append(Character.toChars(i));
}
DES = desBuilder.toString();
System.out.println(DES);
}

public static String parse(String text) {
Pattern pattern = Pattern.compile(D8);
Matcher matcher = pattern.matcher(text);
if(matcher.find()) {
String result = matcher.group();
String target = result.substring(0, 8);
if(ASC.contains(target)) {
return target;
}
}
return "";
}

public static void main(String[] args) throws IOException {
System.out.println("请输入需要检测的文本...");
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String text = reader.readLine();
System.out.println(TextParser.parse(text));
}

}

tools...............
good blog [url]http://www.ophonesdn.com/article/list;jsessionid=FAD3DAF380F339A58E5F92E1B43DC4E1?sort=&tag=136[/url]
apk发编译 [url]http://www.maxhis.info/androiding/android-apk-decompile/[/url]
http://apps.hi.baidu.com/share/detail/39007722

http://video.sina.com.cn/v/b/75355209-1935237481.html


http://blog.csdn.net/kongxx/article/details/7525476

http://wenku.baidu.com/view/a7180912a216147917112823.html

http://www.ibm.com/developerworks/cn/java/j-lo-jsouphtml/

http://www.eoeandroid.com/topic-tag.html?from=forum

http://www.shuangy.com/waigua.html 全图

http://www.oschina.net/code/snippet_16_2735

http://redstarofsleep.iteye.com/blog/1307608

http://blog.csdn.net/xc138/article/details/5904779

http://csvjdbc.sourceforge.net/

http://static.springsource.org/spring-webflow/docs/2.3.x/reference/html/ch04s04.html

http://blog.csdn.net/feng88724/article/details/6859502

http://cxf.apache.org/docs/jax-rs-and-jax-ws.html

<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>apache-cxf</artifactId>
<version>2.7.4</version>
</dependency>

public static void main(String[] args) throws ParseException {
String time = "2013/09/17 13:40";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd HH:mm");
Date date = sdf.parse(time);
System.out.println(date.getTime());
System.out.println("-------------分界线---------------");
long currentTimeStamp = System.currentTimeMillis();
Date now = new Date(currentTimeStamp);
System.out.println(sdf.format(now));
}

http://www.2cto.com/kf/201109/106221.html
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值