package org.litsoft.air.servlet;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class TestUrl {
private static final String Url = "http://localhost:7778/Spa/UnionPayServlet1?a1s2";
public static String result(String url){
String result=null;
String regex="([^?]+$)";
Pattern pattern=Pattern.compile(regex);
Matcher matcher=pattern.matcher(url);
while(matcher.find()){
result=matcher.group();
}
return result;
}
public static void main(String[] args) {
String result=new TestUrl().result(Url);
System.out.println("result="+result);
}
}