String info = "<div>Sprider Programming><head><title>My JSP 'index.jsp' starting page</title><meta http-equiv=/"keywords/" content=/"keyword1,keyword2,keyword3/"><meta http-equiv=/"description/" content=/"This is my page/"></head><a href="/" mce_href="/""http://www.google.com/"></a></div><a href="/" mce_href="/""http://168.168.172.34:678/Sprider/index/aspx/"></a>"; Pattern pattern = Pattern.compile("(?i)(?:<title>|<meta http-equiv=/"description/"|<meta http-equiv=/"keywords/")//s*(?:content=/"|)(.*?)(?:</title>|/")(?-i)"); Matcher matcher = pattern.matcher(info); while (matcher.find()) { System.out.println(matcher.group(1)); }