Here is the scenario
I’m using this regular expression for getting the text inside div tag with id test
<div id = "test">text</div>
$regex = "#\<div id=\"test\"\>(.+?)\<\/div\>#s";
My only requirement is to get the text from div tags in below scenario
<div id="test" class="teating" style="color:red" etc etc .... more attributes >
i.e id being the 1st attribute of div tag and can be followed by n number of attributes.
How to extract text from such a tag by regex only. Please help
Thanks You.
Use this regex :