Linux安全网 - Linux操作系统_Linux 命令_Linux教程_Linux黑客

会员投稿 投稿指南 本期推荐:
搜索:
您的位置: Linux安全网 > Linux编程 > » 正文

java 正则

来源: rjgcx2 分享至:
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author chunxiao
 * @version 1.0
 * @time 2011-12-12 16:48
 */
public class AnaysisUrl {

    public static void main(String[] args) {


        String str = "http://localhost/axix2/services/ManagersUser?sss?xx";
        Pattern pattern = Pattern.compile("/(\\w*)\\?");
        Matcher matcher = pattern.matcher(str);
        while (matcher.find()) {

            System.out.println(matcher.group(1));
        }


    }
}


Tags:
分享至:
最新图文资讯
1 2 3 4 5 6
验证码:点击我更换图片 理智评论文明上网,拒绝恶意谩骂 用户名:
关于我们 - 联系我们 - 广告服务 - 友情链接 - 网站地图 - 版权声明 - 发展历史