I will try it... looks good :) i love this regex stuff, but still have
no clue about.. haha
but if it works.. respect..
can you also do something like sm1 (serge) that includes also
attributes like:
status code=0/
So i guess we need something like.
takeit (OrgString, Tagstring, AltTag)
like:
I'd suggest to take that opportunity to learn on regexp and try a/ to
understand what the one we gave you does and b/ how to modify it with
your new requirement.
Franky, regex are not that hard to come up with -- it is harder to
read an existing one than to write one :-)
I suggest the following
hi ralf, thanks for your answer. but also... your demo did not worked
for me.
You may try it yourself. thanks also for the links, will have a look.
here now for all fellows, two routines that work
- with regular tags.. if they have innertags or not
- and a routine that looks specialy for
Looks good guruk. It's quite fast. I timed it.
fyi: The code I posted earlier can also work with input of xml tags
with attributes, such as
Hello, this is a test start attr1=\value1\12345/start ...
which is common with tags, and it also avoids raising the nasty
RuntimeException
thanks serge, great communication.
right now its ok for me, because the code who does create the tags is
also from me :)
so i can be sure there is always a start and ending tag.
just for anyone who is interested here an extended version that does
allow to
search for several tags in a long
Or the equivalent:
public String takeit(String input, String tag) {
Pattern p = Pattern.compile(.*?( + tag + )([^]*)/\\1);
Matcher m = p.matcher(input);
return m.matches() ? m.group(2) : null;
}
R/
On Thu, Mar 12, 2009 at 1:34 PM, EECOLOR eeco...@gmail.com wrote:
I think that
I think that the methods proposed here are very heavy:
XML Parsing is too much for that easy task
Check it manually is not optimal
I suggest you to have a look on the class StringTokenizer:
http://developer.android.com/reference/java/util/StringTokenizer.html
Albert
On Mar 13, 11:57 pm, sm1
Hi and thanks for all your great help
So I also like to share what I use now
public String TakeIt (String xtag, String xhtml)
{
String x1tag = + xtag + ;
String x2tag = / + xtag + ;
int xstart = xhtml.indexOf(x1tag);
int
Albert,
I don't think that it can be done using StringTokenizer.
serge
On Mar 14, 12:17 pm, Albert Hernández albert.hernan...@gmail.com
wrote:
I think that the methods proposed here are very heavy:
XML Parsing is too much for that easy task
Check it manually is not optimal
I suggest you to
I think you need to use parse for that.
2009/3/12 guruk ilovesi...@gmail.com
Hi,
i have a long String and need to capture some text in between of some
tags.
for example:
myString=Hello, this is a test start12345/start and here i like
to say markioioidddad/marki what is that
I think that would be something like this:
public String takeit(String str, String tag)
{
return str.replace(.*? + tag + (.*?)/ + tag + .*, $1);
}
Greetz Erik
On Thu, Mar 12, 2009 at 7:14 PM, guruk ilovesi...@gmail.com wrote:
Hi,
i have a long String and need to capture some text in
I do it this way (it works for me):
/**
* @param tag The tag without the angle bracket, i.e.,
* the given value does not start with lt;.
* @param str The string containing the tags and data.
* @return empty string when tag absent or str invalid.
*/
String
12 matches
Mail list logo