Hi,

try this
               String result = null;
               String regexp = "<node-to-find>(.*?)</node-to-find>";
               RE r = new RE(regexp, RE.MATCH_SINGLELINE);
               if (r.match(str)) {
                   result = r.getParen(1);
               }

greetings Patrick


COURTAULT Francois wrote:

Hello,

I have a java String which is :

"<test>\n\t<test2>XXXX</test2>\n\t<test3>YYYY</test3>\n\t<node-to-find>\n\t\t<tt>\n\t\t\t<ttt>vvvv</ttt>\n\t\t</tt>\n\t</node-to-find>\n</test>"

I want to search a RE which begins by <node-to-find> and ends by </node-to-find> inside these two strings, you can have any character.

How can you define the RE for that purpose ? I have tried 
<node-to-find>.*</node-to-find>
without success !

Any idea ?

Regards.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to