在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/Java/ 正則表達式如何取出被@包裹的字符串?

正則表達式如何取出被@包裹的字符串?

select * , @ as iid from as_person where icorp = @icorp@ and iperosn = @iperson@
如何通過正則表達式取出被@包裹的數(shù)據(jù),取出icorp,iperson?

回答
編輯回答
焚音
        String express = "(\\@\\w+\\@)";
        String sqlString = "select * , @ as iid from as_person where icorp = @icorp@ and iperosn = @iperson@";
        Matcher match = Pattern.compile(express).matcher(sqlString);
        while (match.find()) {
            System.out.println(match.group());
        }

結果是
@icorp@
@iperson@

2017年4月5日 14:21
編輯回答
離殤
String express = "@(\\w+)@";
        String sqlString = "select * , @ as iid from as_person where icorp = @icorp@ and iperosn = @iperson@";
        Matcher match = Pattern.compile(express).matcher(sqlString);
        while (match.find()) {
            System.out.println(match.group(1));
        }
2017年12月7日 16:38