这样一个字符串:
/test.do?biz=#bizKeyValue#&bar=#barCode#
我需要把"#...#"之间的字符串取出来,比如这里是bizKeyValue和barCode,
然后用实际的值替换。
请问这个怎么解析?
我要具体的代码,谢谢。
/test.do?biz=#bizKeyValue#&bar=#barCode#
我需要把"#...#"之间的字符串取出来,比如这里是bizKeyValue和barCode,
然后用实际的值替换。
请问这个怎么解析?
我要具体的代码,谢谢。
Pattern pattern=Pattern.compile("#[^#]*#");
Matcher matcher=pattern.matcher(str);
while(matcher.find()){
System.out.println(str.substring(matcher.start(),matcher.end()));
}