We help IT Professionals succeed at work.

Perl regular expression

saibsk
saibsk asked
on
<tr><td><b>Definition</b><div> <div>The sub-account of the safekeeping or investment account.</div></div></td>
            </tr>

<tr><td><b>Definition</b> <div>Unique identifier for an account. It is assigned by the account servicer using a proprietary identification scheme.</div></td>
                  </tr>

I need to retrieve the Definition description ie "The sub-account of the safekeeping or investment account",
"Unique identifier for an account. It is assigned by the account servicer using a proprietary identification scheme",  from both the above statements. How can I write just one Perl regular expression for both? Please advise.
Comment
Watch Question

CERTIFIED EXPERT
Most Valuable Expert 2014
Top Expert 2015
Commented:
$_='<tr><td><b>Definition</b><div> <div>The sub-account of the safekeeping or investment account.</div></div></td>
            </tr>

<tr><td><b>Definition</b> <div>Unique identifier for an account. It is assigned by the account servicer using a proprietary identification scheme.</div></td>
                  </tr>';
@descriptions = m#<b>Definition</b>(?:\s*<div>)+(.*?)</div>#g;

Author

Commented:
The above two files are in two different files. So when I read the file I want the regular expression to return the description. So it would return a scalar value.

Author

Commented:
The above lines I mean are in two different files.
ozo
CERTIFIED EXPERT
Most Valuable Expert 2014
Top Expert 2015

Commented:
($description) = m#<b>Definition</b>(?:\s*<div>)+(.*?)</div>#;

Author

Commented:
Works great thanks.

Explore More ContentExplore courses, solutions, and other research materials related to this topic.