Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #3287
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail |
|---|---|
| From | "John B. Matthews" <nospam@nospam.invalid> |
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: get head tag data |
| Date | Tue, 26 Apr 2011 16:14:44 -0400 |
| Organization | The Wasteland |
| Lines | 31 |
| Message-ID | <nospam-0BCF89.16144426042011@news.aioe.org> (permalink) |
| References | <13d79f2e-d496-4896-ad0b-2ab658818b51@l2g2000prg.googlegroups.com> <ip78b4$g22$1@dont-email.me> |
| NNTP-Posting-Host | LQJtZWzu+iKlBROuDg+IUg.user.speranza.aioe.org |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8 |
| Content-Transfer-Encoding | 7bit |
| X-Complaints-To | abuse@aioe.org |
| User-Agent | MT-NewsWatcher/3.5.3b3 (Intel Mac OS X) |
| X-Notice | Filtered by postfilter v. 0.8.2 |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:3287 |
Show key headers only | View raw
In article <ip78b4$g22$1@dont-email.me>,
Stanimir Stamenkov <s7an10@netscape.net> wrote:
> Tue, 26 Apr 2011 11:15:51 -0700 (PDT), /kapil/:
>
> > i want to retrieve data that is available in between <head></head>
> > tag...in jsp using programming..
> > any one know that how to fetch that data..??
>
> If you have the whole jsp content in a String variable, you could
> use regular expression, e.g.:
>
> String jspContent;
> ...
> String headContent = jspContent
> .replaceAll("(?s).*<head>(.*)</head>.*", "$1");
> System.out.println(headContent);
>
> You may read the java.util.regex.Pattern class documentation and the
> Java Tutorial lesson on Regular Expressions for more info:
>
> http://download.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html
>
> http://download.oracle.com/javase/tutorial/essential/regex/index.html
With some caveats: <http://stackoverflow.com/questions/1732348>.
--
John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar
get head tag data kapil <kapil.purohit1441@gmail.com> - 2011-04-26 11:15 -0700
Re: get head tag data Stanimir Stamenkov <s7an10@netscape.net> - 2011-04-26 23:01 +0300
Re: get head tag data "John B. Matthews" <nospam@nospam.invalid> - 2011-04-26 16:14 -0400
Re: get head tag data kapil <kapil.purohit1441@gmail.com> - 2011-04-28 02:55 -0700
csiph-web