Remove html tags from a string containing a web page source code

Could anyone please tell me how to remove html tags in jdk1.4.0? I am able to grab the HTML source code of a URL.

Thanks in advance.

Regards.
kbh

Comments

  • : Could anyone please tell me how to remove html tags in jdk1.4.0? I am able to grab the HTML source code of a URL.
    :
    Do it with regexes. Use the Pattern class. I *think* it will look something like this:-

    [code]Pattern remHTML = Pattern.compile("<[^>]>");
    Matcher m = remHTML.matcher(theText);
    String theText = m.replaceAll("");[/code]

    Jonathan

    ###
    for(74,117,115,116){$::a.=chr};(($_.='qwertyui')&&
    (tr/yuiqwert/her anot/))for($::b);for($::c){$_.=$^X;
    /(p.{2}l)/;$_=$1}$::b=~/(..)$/;print("$::a$::b $::c hack$1.");

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion