Pattern p = Pattern.compile("\w+");
Matcher m_yue = p.matcher("3月24日");
String yue = "";
String ri = "";
if(m_yue.find())
{
yue = m_yue.group(1);
ri = m_yue.group(2);
}如何取匹配到的3和24,我的方法好像不可以
Matcher m_yue = p.matcher("3月24日");
String yue = "";
String ri = "";
if(m_yue.find())
{
yue = m_yue.group(1);
ri = m_yue.group(2);
}如何取匹配到的3和24,我的方法好像不可以
pattern = "(xxxx)(yyyyy)"最终group(1) 就是xxxx group(2) 就是yyyyy默认好像是整个串是group(0) 也就是group(0) = xxxxyyyyy