public class RegexTest
{
/**
* Description of this Method
* @author Wangqy
* @since Jan 13, 2009
* @param args
*/
public static void main(String[] args)
{
String regex = "^(///[A-Za-z]+///[A-Za-z]+//_[A-Za-z]+//_[a-z]+//.action)?$";
Pattern pattern = Pattern.compile(regex);
Matcher matcher = pattern.matcher("/admin/admin_add_a.action");
if(matcher.find()){
System.out.println(" result: " + matcher.group());
}else{
System.out.println("not match");
}
}
}
action请求正则表达式
最新推荐文章于 2024-06-04 19:10:15 发布