COURTAULT Francois writes:
> 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 !

I think the problem is that "." matches any character other than
newline, and your string obviously contains newlines.  So instead of
".*", you need something like "(.*\n?)*".

-- 
Kevin Rodgers


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

Reply via email to