我有一个53k的html文件,希望将文件代码读到字符串中,然后用正则表达式匹配。
发现字符串中只保存了10k的内容。(我将字符串中的内容拷贝到另一个文本文件中,看文件大小的)
请问如何解决?

解决方案 »

  1.   

    strParttern="<th width=\"100%\">([(\\w\\W)*?]+)-([(\\w\\W)*?]+):([(\\w\\W)*?]+)(([(\\w\\W)*?]+):)([(\\w\\W)*?]+)</th>";
    pattern = Pattern.compile(strParttern);
    m=pattern.matcher(sb);
    if (m.find()){
    strTemp1=m.group();
    }
    System.out.print(sb);
    当程序走到m.find()时,程序就坐不动了。sb变量中存储了几十K的HTML代码。
    怎么办?
      

  2.   

    <th width="100%">Spielstatistik FC Sunderland - Newcastle United 1:1 (0:0)</th>
    如何用正则表达式表示这句话。