正则表达式提取字串

 String   s   =   "<img   src=\"image/icons/cloudday_small.gif\"   width=\"20\"   height=\"20\">dfsdf<img   src=\"image/icons/cloudday_454.gif\"   width=\"20\"   height=\"20\">";  
  Matcher   m   =   Pattern.compile("src=\"?(.*?)(\"|>|\\s+)").matcher(s);  
  while(m.find())  
  {  
  System.out.println(m.group(1));  
  }

你可能感兴趣的:(正则表达式)