求正则表达式,str = "Ta.a >= Tb.a";
public static void substring(){
String str = "Ta.a >= Tb.a";
Pattern p = Pattern.compile("(.+)\\.(.+)([<=>]{1,2})(.+)\\.(.+)");
Matcher m = p.matcher(str);
System.out.println(m.find());
System.out.println(m.groupCount());
System.out.println(m.group(1));
System.out.println(m.group(2));
System.out.println(m.group(3));
System.out.println(m.group(4));
}
我要匹配出Ta,a,>=,Tb,a 其中a与〉=间不一定有空格〉=与Tb也一样,〉=不是固定的,包含〉,< ,=,<>
>=,<=,
上边是我写的,但在取<=>符号时老有问题,请高手帮忙看看,下班前结贴!