M
Marc E
is there a way to do regex backreference replacement with the String class
without Pattern and Matcher? for example, I'd like to do something like
this:
String somebigstring = "blahblahblah<hooey>and some stuff here</hooey> and
some other stuff";
String mystring = somebigstring.replace("(.*)<hooey>(*.)</hooey","\2");
such that mystring is then the stuff between the hooey tags.
just seems to me that the 4-5 lines of pattern/matcher code i have to write
to achieve this is way overkill and so i have to believe there's a much
simpler way to do it with String, but i can't get backreferences to work in
replacements. probably missign something stupid, but i can't find it.
thanks a lot.
Marc
without Pattern and Matcher? for example, I'd like to do something like
this:
String somebigstring = "blahblahblah<hooey>and some stuff here</hooey> and
some other stuff";
String mystring = somebigstring.replace("(.*)<hooey>(*.)</hooey","\2");
such that mystring is then the stuff between the hooey tags.
just seems to me that the 4-5 lines of pattern/matcher code i have to write
to achieve this is way overkill and so i have to believe there's a much
simpler way to do it with String, but i can't get backreferences to work in
replacements. probably missign something stupid, but i can't find it.
thanks a lot.
Marc