java string截取两个字符串之间的值
import java.util.regex.Matcher;import java.util.regex.Pattern; public class GetTag {public static void main(String[] args){ String str = "abcdef deftfha "; Pattern p=Pattern.compile("(\\w+) "); Matcher m=p.matcher(str); while(m.find()){ System.out.println(m.group(1)); } }}