【发布时间】:2014-05-13 17:52:53
【问题描述】:
我正在使用正则表达式来中断字符串,我正在尝试中断字符串,但在正则表达式中我缺少一些格式。谁能告诉我我哪里出错了。
String betweenstring="['Sheet 1$'].[DEPTNO] AS [DEPTNO]";
System.out.println("betweenstring: "+betweenstring);
Pattern pattern = Pattern.compile("\\w+[.]\\w+");
Matcher matchers=pattern.matcher(betweenstring);
while(matchers.find())
{
String filtereddata=matchers.group(0);
System.out.println("filtereddata: "+filtereddata);
}
我需要这样打破:
['Sheet 1$']
[DEPTNO] AS [DEPTNO]
【问题讨论】:
-
定义“断线”是什么意思
-
我已更新请检查一次