Examinee
packagecom.huaweisymantec.rmc.mail;
importjava.util.regex.Matcher;
importjava.util.regex.Pattern;
//输入一行要解析的字符串,和相应的正则表达式和序号返回解析后的字符串
publicclassExaminee{
staticStringsubString=null;
publicStringexamine(Strings,Stringregex,inti)
{
Displayd=newDisplay(regex);
Patternp=Pattern.compile(regex);
Matcherm=p.matcher(s);
while(m.find())
{
StringmGroup=m.group();
subString=mGroup.substring(2,mGroup.length()-1);
System.out.println(i+subString);
}
returnsubString;
}
publicstaticStringgetSubString()
{
returnsubString;
}
}
相关推荐
sunlizhen 2020-06-01
kuoying 2020-05-12
嗡汤圆 2020-05-02
好记忆也需烂 2020-04-18
heray0 2020-04-15
chouliqingke 2019-12-18
aanndd 2019-12-08
zangdaiyang 2019-12-05
chenxiangis 2019-11-01
ThinkingLink 2019-11-01
TMD咯MySQL 2019-09-05
kxr00 2012-07-14
Ongoingcre 2011-06-08
zjhqlmzldx 2011-05-10
hongsheyoumo 2010-03-02
huha 2009-11-12
MarkArch 2019-06-30