select * , @ as iid from as_person where icorp = @icorp@ and iperosn = @iperson@
如何通过正则表达式取出被@包裹的数据,取出icorp,iperson?
select * , @ as iid from as_person where icorp = @icorp@ and iperosn = @iperson@
如何通过正则表达式取出被@包裹的数据,取出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@
15 回答6.9k 阅读
2 回答3.3k 阅读✓ 已解决
2 回答10.5k 阅读✓ 已解决
3 回答7k 阅读✓ 已解决
5 回答4.7k 阅读
3 回答5.2k 阅读
4 回答2.4k 阅读