´ç½Å¿¡°Ô·Î ¶°³ª´Â ²Þ¼Ó¿©Çà - ²Þ¼Ó³ª¶ó(http://www.inyourdream.net) ÀÔ±¹Çϱâ | ¿µÁÖ±Ç ½Åû
  • ¸öºÎ¸² °ñ¶ó°ñ¶ó
  • ¼Ò±Ù¼Ò±Ù
  • µµ¶õµµ¶õ
  • ³«¼­¸¶´ç
  • Âø°¢ÇѾÆÀÌ
  • ¼ýÀÚ¸ÂÃß±â
  • ¼Ò¿øºô±â
  • ÈçÀû³²±â±â
  • ²Þ¼Ó¿©Çà
  • Ä£±¸Áý ³î·¯°¡±â
  • ¸ðµÎµå¸²´ÔÀÇ È¨
  • î¤éÞ´ÔÀÇ È¨
  • Çö¿ì´ÔÀÇ È¨
  • º°¾ÆÇØ´ÔÀÇ È¨
  • ÇÞ»ì´ÔÀÇ È¨
  • À̳ª´Ï´ÔÀÇ È¨
  • À¯¸®¾Ë´ÔÀÇ È¨
  • ³È³ÈÀÌ´ÔÀÇ È¨
  • ²ÀÁö´ÔÀÇ È¨
  • ´ë¼º´ÔÀÇ È¨
  • î¤éÞ / 2010-01-21 / ¿ÀÈÄ 3:27:59 / 24.10.174.180
    Á¶È¸¼ö : 628
    [Ãßõ] [Æۿ±Û] ÀÚ¹Ù½ºÆ®¸³Æ® HTML ÅÂ±× Á¦°Å
    private String getText(String content) {
    Pattern SCRIPTS = Pattern.compile("<(no)?script[^>]*>.*?</(no)?script>",Pattern.DOTALL);
    Pattern STYLE = Pattern.compile("<style[^>]*>.*</style>",Pattern.DOTALL);
    Pattern TAGS = Pattern.compile("<(\"[^\"]*\"|\'[^\']*\'|[^\'\">])*>");
    Pattern nTAGS = Pattern.compile("<\\w+\\s+[^<]*\\s*>");
    Pattern ENTITY_REFS = Pattern.compile("&[^;]+;");
    Pattern WHITESPACE = Pattern.compile("\\s\\s+");

    Matcher m;

    m = SCRIPTS.matcher(content);
    content = m.replaceAll("");
    m = STYLE.matcher(content);
    content = m.replaceAll("");
    m = TAGS.matcher(content);
    content = m.replaceAll("");
    m = ENTITY_REFS.matcher(content);
    content = m.replaceAll("");
    m = WHITESPACE.matcher(content);
    content = m.replaceAll(" ");

    return content;
    }
    Byte * 200 Byte À̳»·Î ÀÔ·ÂÇϼ¼¿ä À̸§ : Æнº¿öµå :