You can't, specifically. For example, the following will capture your
example:
(?s)<div>.*</div>
However, a div may contain nested elements, and if any of them is a div, it
will capture only the outermost div, as in:
<div>whatever text goes here, and maybe it
contains a carriage return and/or line feed
<div>whatever text goes here, and maybe it
contains a carriage return and/or line feed
and it spans in multiple lines</div>
and it spans in multiple lines</div>
So, you can't do this with a regular expression alone.
--
HTH,
Kevin Spencer
Microsoft MVP
Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net
"mehdi" <me***********@gmail.comwrote in message
news:11**********************@u30g2000hsc.googlegr oups.com...
Hi,
Consider the following string:
<div>whatever text goes here, and maybe it
contains a carriage return and/or line feed
and it spans in multiple lines</div>
How am I supposed to write an expression that returns the div's
content?
Any help would be highly appreciated,
TIA,
Mehdi