Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail From: "John B. Matthews" 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: References: <13d79f2e-d496-4896-ad0b-2ab658818b51@l2g2000prg.googlegroups.com> 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 In article , Stanimir Stamenkov wrote: > Tue, 26 Apr 2011 11:15:51 -0700 (PDT), /kapil/: > > > i want to retrieve data that is available in between > > 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).*(.*).*", "$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: . -- John B. Matthews trashgod at gmail dot com