Regular Expression

view full story

http://www.unix.com – Hello, I want to extract text between <td class="di_resultscolumnheader"> and </td>. I wrote the below code to extract text. But I am able to extract the text for the first match only. Can some one help me in this? Thanks in advance. Code: if ($line =~ /<td class="di_resultscolumnheader">(.*?)<\/td>/g) { print $1,"\n"; } Sample Input: <td class="di_resultscolumnheader">Object</td><td class="di_resultscolumnheader">Precipitant</td><td class="di_resultscolumnheader (HowTos)